File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
packages/react/src/slider/root Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -72,12 +72,14 @@ export function focusThumb(
72
72
return ;
73
73
}
74
74
75
- const doc = ownerDocument ( sliderRef . current ) ;
75
+ const activeEl = activeElement ( ownerDocument ( sliderRef . current ) ) ;
76
76
77
77
if (
78
- ! sliderRef . current . contains ( doc . activeElement ) ||
79
- Number ( doc ?. activeElement ?. getAttribute ( SliderThumbDataAttributes . index ) ) !== thumbIndex
78
+ activeEl == null ||
79
+ ! sliderRef . current . contains ( activeEl ) ||
80
+ Number ( activeEl . getAttribute ( SliderThumbDataAttributes . index ) ) !== thumbIndex
80
81
) {
82
+ // TODO: possibly simplify with thumbRefs as it already exists
81
83
(
82
84
sliderRef . current . querySelector (
83
85
`[type="range"][${ SliderThumbDataAttributes . index } ="${ thumbIndex } "]` ,
You can’t perform that action at this time.
0 commit comments