Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Performance issues in development environment #89

Merged
merged 12 commits into from
Nov 5, 2019
Prev Previous commit
Next Next commit
Fix CheckBox focus
tassoevan committed Nov 1, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 7ffca58bdfd35f8505bc5ed446da446134d3d8e6
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions packages/fuselage/src/components/CheckBox/index.js
Original file line number Diff line number Diff line change
@@ -24,12 +24,12 @@ export const CheckBox = React.forwardRef(function CheckBox({

useLayoutEffect(() => {
innerRef.current.indeterminate = indeterminate;
}, [indeterminate]);
}, [innerRef, indeterminate]);

const handleChange = useCallback((event) => {
innerRef.current.indeterminate = indeterminate;
onChange && onChange.call(innerRef.current, event);
}, [indeterminate, onChange]);
}, [innerRef, indeterminate, onChange]);

return <Container className={className} hidden={hidden} invisible={invisible} style={style}>
<Input ref={mergedRef} type='checkbox' onChange={handleChange} {...props} />
6 changes: 3 additions & 3 deletions packages/fuselage/src/components/CheckBox/styles.js
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ const uncheckedDefaultState = css`
const uncheckedFocusState = css`
border-color: ${ ({ theme }) => theme.buttonColors.empty.focusBorderColor };
background-color: ${ ({ theme }) => theme.buttonColors.empty.focusBackgroundColor };
box-shadow: 0 0 0 to-rem(6) ${ ({ theme }) => theme.buttonColors.empty.focusShadowColor };
box-shadow: 0 0 0 ${ toRem(6) } ${ ({ theme }) => theme.buttonColors.empty.focusShadowColor };
`;

const uncheckedHoverState = css`
@@ -110,7 +110,7 @@ const checkedDefaultState = css`
const checkedFocusState = css`
border-color: ${ ({ theme }) => theme.buttonColors.primary.focusBorderColor };
background-color: ${ ({ theme }) => theme.buttonColors.primary.focusBackgroundColor };
box-shadow: 0 0 0 to-rem(6) ${ ({ theme }) => theme.buttonColors.primary.focusShadowColor };
box-shadow: 0 0 0 ${ toRem(6) } ${ ({ theme }) => theme.buttonColors.primary.focusShadowColor };
`;

const checkedHoverState = css`
@@ -155,7 +155,7 @@ const indeterminateDefaultState = css`
const indeterminateFocusState = css`
border-color: ${ ({ theme }) => theme.buttonColors.primary.focusBorderColor };
background-color: ${ ({ theme }) => theme.buttonColors.primary.focusBackgroundColor };
box-shadow: 0 0 0 to-rem(6) ${ ({ theme }) => theme.buttonColors.primary.focusShadowColor };
box-shadow: 0 0 0 ${ toRem(6) } ${ ({ theme }) => theme.buttonColors.primary.focusShadowColor };
`;

const indeterminateHoverState = css`