File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -9,14 +9,11 @@ export function useRovingCellRef(isSelected: boolean) {
99 setIsChildFocused ( false ) ;
1010 }
1111
12- const ref = useCallback (
13- ( cell : HTMLDivElement | null ) => {
14- if ( cell === null || ! isSelected || cell . contains ( document . activeElement ) ) return ;
12+ const ref = useCallback ( ( cell : HTMLDivElement | null ) => {
13+ if ( cell === null || cell . contains ( document . activeElement ) ) return ;
1514
16- cell . focus ( { preventScroll : true } ) ;
17- } ,
18- [ isSelected ]
19- ) ;
15+ cell . focus ( { preventScroll : true } ) ;
16+ } , [ ] ) ;
2017
2118 function onFocus ( event : React . FocusEvent < HTMLDivElement > ) {
2219 if ( event . target !== event . currentTarget ) {
@@ -27,7 +24,7 @@ export function useRovingCellRef(isSelected: boolean) {
2724 const isFocused = isSelected && ! isChildFocused ;
2825
2926 return {
30- ref,
27+ ref : isSelected ? ref : undefined ,
3128 tabIndex : isFocused ? 0 : - 1 ,
3229 onFocus
3330 } ;
You can’t perform that action at this time.
0 commit comments