Skip to content

Commit

Permalink
fix: make eslint rule not crash
Browse files Browse the repository at this point in the history
  • Loading branch information
jaworek committed Sep 12, 2022
1 parent 96ee6bc commit 0697dbe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/components/FAB/AnimatedFAB.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,8 @@ const AnimatedFAB = ({
const md2Elevation = disabled || !isIOS ? 0 : 6;
const md3Elevation = disabled || !isIOS ? 0 : 3;

const newAccessibilityState = { ...accessibilityState, disabled };

return (
<Surface
{...rest}
Expand Down Expand Up @@ -400,7 +402,7 @@ const AnimatedFAB = ({
disabled={disabled}
accessibilityLabel={accessibilityLabel}
accessibilityRole="button"
accessibilityState={{ ...accessibilityState, disabled }}
accessibilityState={newAccessibilityState}
testID={testID}
style={{ borderRadius }}
>
Expand Down
4 changes: 3 additions & 1 deletion src/components/FAB/FAB.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ const FAB = ({

const md3Elevation = isFlatMode || disabled ? 0 : 3;

const newAccessibilityState = { ...accessibilityState, disabled };

return (
<Surface
{...rest}
Expand Down Expand Up @@ -253,7 +255,7 @@ const FAB = ({
disabled={disabled}
accessibilityLabel={accessibilityLabel}
accessibilityRole="button"
accessibilityState={{ ...accessibilityState, disabled }}
accessibilityState={newAccessibilityState}
testID={testID}
>
<View
Expand Down

0 comments on commit 0697dbe

Please sign in to comment.