Skip to content

Commit 670afe7

Browse files
jonnybelmontezume
authored andcommitted
fix(checkbox): hovered state when disabled (#775)
1 parent 06e9420 commit 670afe7

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/components/inputs/checkbox-input/checkbox-input.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ const sequentialId = createSequentialId('checkbox-input-');
1717
const Label = styled.label`
1818
display: flex;
1919
align-items: center;
20-
cursor: ${props => (props.isDisabled ? 'not-allowed' : 'pointer')};
20+
cursor: ${props => (props.disabled ? 'not-allowed' : 'pointer')};
2121
position: relative;
2222
${props =>
2323
!props.hasError &&
24+
!props.disabled &&
2425
` &:hover svg [id$='borderAndContent'] > [id$='border'] {
2526
stroke: ${vars.borderColorForInputWhenFocused};
2627
}`}
@@ -64,7 +65,11 @@ class CheckboxInput extends React.PureComponent {
6465

6566
render() {
6667
return (
67-
<Label htmlFor={this.state.id} hasError={this.props.hasError}>
68+
<Label
69+
htmlFor={this.state.id}
70+
hasError={this.props.hasError}
71+
disabled={this.props.isDisabled}
72+
>
6873
<Checkbox
6974
type="checkbox"
7075
id={this.state.id}

0 commit comments

Comments
 (0)