@@ -14,7 +14,14 @@ import ArrowDownSmall from '@spectrum-icons/ui/ArrowDownSmall';
14
14
import { chain , mergeProps , useLayoutEffect } from '@react-aria/utils' ;
15
15
import { Checkbox } from '@react-spectrum/checkbox' ;
16
16
import ChevronDownMedium from '@spectrum-icons/ui/ChevronDownMedium' ;
17
- import { classNames , useDOMRef , useFocusableRef , useStyleProps , useUnwrapDOMRef } from '@react-spectrum/utils' ;
17
+ import {
18
+ classNames ,
19
+ useDOMRef ,
20
+ useFocusableRef ,
21
+ useIsMobileDevice ,
22
+ useStyleProps ,
23
+ useUnwrapDOMRef
24
+ } from '@react-spectrum/utils' ;
18
25
import { DOMRef , FocusableRef , MoveMoveEvent } from '@react-types/shared' ;
19
26
import { FocusRing , FocusScope , useFocusRing } from '@react-aria/focus' ;
20
27
import { getInteractionModality , useHover , usePress } from '@react-aria/interactions' ;
@@ -653,18 +660,26 @@ function ResizableTableColumnHeader(props) {
653
660
return options ;
654
661
// eslint-disable-next-line react-hooks/exhaustive-deps
655
662
} , [ allowsSorting ] ) ;
663
+ let isMobile = useIsMobileDevice ( ) ;
656
664
657
665
useEffect ( ( ) => {
658
666
if ( columnState . currentlyResizingColumn === column . key ) {
659
667
// focusSafely won't actually focus because the focus moves from the menuitem to the body during the after transition wait
660
668
// without the immediate timeout, Android Chrome doesn't move focus to the resizer
669
+ if ( isMobile ) {
670
+ setTimeout ( ( ) => {
671
+ resizingRef . current . focus ( ) ;
672
+ onFocusedResizer ( ) ;
673
+ } , 400 ) ;
674
+ return ;
675
+ }
661
676
setTimeout ( ( ) => {
662
677
resizingRef . current . focus ( ) ;
663
678
onFocusedResizer ( ) ;
664
679
} , 0 ) ;
665
680
}
666
681
// eslint-disable-next-line react-hooks/exhaustive-deps
667
- } , [ columnState . currentlyResizingColumn , column . key ] ) ;
682
+ } , [ columnState . currentlyResizingColumn , column . key , isMobile ] ) ;
668
683
669
684
let showResizer = ! isEmpty && ( ( headerRowHovered && getInteractionModality ( ) !== 'keyboard' ) || columnState . currentlyResizingColumn != null ) ;
670
685
0 commit comments