@@ -32,13 +32,11 @@ function Checkbox(props: SpectrumCheckboxProps, ref: FocusableRef<HTMLLabelEleme
32
32
let {
33
33
isIndeterminate = false ,
34
34
isEmphasized = false ,
35
- isDisabled = false ,
36
35
autoFocus,
37
36
children,
38
37
...otherProps
39
38
} = props ;
40
39
let { styleProps} = useStyleProps ( otherProps ) ;
41
- let { hoverProps, isHovered} = useHover ( { isDisabled} ) ;
42
40
43
41
let inputRef = useRef < HTMLInputElement > ( null ) ;
44
42
let domRef = useFocusableRef ( ref , inputRef ) ;
@@ -47,7 +45,7 @@ function Checkbox(props: SpectrumCheckboxProps, ref: FocusableRef<HTMLLabelEleme
47
45
// This is a bit unorthodox. Typically, hooks cannot be called in a conditional,
48
46
// but since the checkbox won't move in and out of a group, it should be safe.
49
47
let groupState = useContext ( CheckboxGroupContext ) ;
50
- let { inputProps, isInvalid} = groupState
48
+ let { inputProps, isInvalid, isDisabled } = groupState
51
49
// eslint-disable-next-line react-hooks/rules-of-hooks
52
50
? useCheckboxGroupItem ( {
53
51
...props ,
@@ -64,6 +62,8 @@ function Checkbox(props: SpectrumCheckboxProps, ref: FocusableRef<HTMLLabelEleme
64
62
// eslint-disable-next-line react-hooks/rules-of-hooks
65
63
: useCheckbox ( props , useToggleState ( props ) , inputRef ) ;
66
64
65
+ let { hoverProps, isHovered} = useHover ( { isDisabled} ) ;
66
+
67
67
let markIcon = isIndeterminate
68
68
? < DashSmall UNSAFE_className = { classNames ( styles , 'spectrum-Checkbox-partialCheckmark' ) } />
69
69
: < CheckmarkSmall UNSAFE_className = { classNames ( styles , 'spectrum-Checkbox-checkmark' ) } /> ;
0 commit comments