@@ -23,7 +23,7 @@ import {
2323 useUnwrapDOMRef
2424} from '@react-spectrum/utils' ;
2525import { ColumnSize , SpectrumColumnProps , SpectrumTableProps } from '@react-types/table' ;
26- import { DOMRef , FocusableRef , MoveMoveEvent } from '@react-types/shared' ;
26+ import { DOMRef , FocusableRef } from '@react-types/shared' ;
2727import { FocusRing , FocusScope , useFocusRing } from '@react-aria/focus' ;
2828import { getInteractionModality , useHover , usePress } from '@react-aria/interactions' ;
2929import { GridNode } from '@react-types/grid' ;
@@ -97,7 +97,6 @@ interface TableContextValue<T> {
9797 onResizeStart : ( widths : Map < Key , ColumnSize > ) => void ,
9898 onResize : ( widths : Map < Key , ColumnSize > ) => void ,
9999 onResizeEnd : ( widths : Map < Key , ColumnSize > ) => void ,
100- onMoveResizer : ( e : MoveMoveEvent ) => void ,
101100 headerMenuOpen : boolean ,
102101 setHeaderMenuOpen : ( val : boolean ) => void
103102}
@@ -361,14 +360,6 @@ function TableView<T extends object>(props: SpectrumTableProps<T>, ref: DOMRef<H
361360 bodyRef . current . scrollLeft = headerRef . current . scrollLeft ;
362361 } ;
363362
364- let lastResizeInteractionModality = useRef ( undefined ) ;
365- let onMoveResizer = ( e ) => {
366- if ( e . pointerType === 'keyboard' ) {
367- lastResizeInteractionModality . current = e . pointerType ;
368- } else {
369- lastResizeInteractionModality . current = undefined ;
370- }
371- } ;
372363 let onResizeStart = useCallback ( ( widths ) => {
373364 setIsResizing ( true ) ;
374365 propsOnResizeStart ?.( widths ) ;
@@ -380,7 +371,7 @@ function TableView<T extends object>(props: SpectrumTableProps<T>, ref: DOMRef<H
380371 } , [ propsOnResizeEnd , setIsInResizeMode , setIsResizing ] ) ;
381372
382373 return (
383- < TableContext . Provider value = { { state, layout, onResizeStart, onResize : props . onResize , onResizeEnd, headerRowHovered, isInResizeMode, setIsInResizeMode, isEmpty, onFocusedResizer, onMoveResizer , headerMenuOpen, setHeaderMenuOpen} } >
374+ < TableContext . Provider value = { { state, layout, onResizeStart, onResize : props . onResize , onResizeEnd, headerRowHovered, isInResizeMode, setIsInResizeMode, isEmpty, onFocusedResizer, headerMenuOpen, setHeaderMenuOpen} } >
384375 < TableVirtualizer
385376 { ...mergeProps ( gridProps , focusProps ) }
386377 { ...styleProps }
@@ -411,15 +402,14 @@ function TableView<T extends object>(props: SpectrumTableProps<T>, ref: DOMRef<H
411402 onVisibleRectChange = { onVisibleRectChange }
412403 domRef = { domRef }
413404 headerRef = { headerRef }
414- lastResizeInteractionModality = { lastResizeInteractionModality }
415405 bodyRef = { bodyRef }
416406 isFocusVisible = { isFocusVisible } />
417407 </ TableContext . Provider >
418408 ) ;
419409}
420410
421411// This is a custom Virtualizer that also has a header that syncs its scroll position with the body.
422- function TableVirtualizer ( { layout, collection, lastResizeInteractionModality , focusedKey, renderView, renderWrapper, domRef, bodyRef, headerRef, onVisibleRectChange : onVisibleRectChangeProp , isFocusVisible, ...otherProps } ) {
412+ function TableVirtualizer ( { layout, collection, focusedKey, renderView, renderWrapper, domRef, bodyRef, headerRef, onVisibleRectChange : onVisibleRectChangeProp , isFocusVisible, ...otherProps } ) {
423413 let { direction} = useLocale ( ) ;
424414 let loadingState = collection . body . props . loadingState ;
425415 let isLoading = loadingState === 'loading' || loadingState === 'loadingMore' ;
@@ -466,11 +456,11 @@ function TableVirtualizer({layout, collection, lastResizeInteractionModality, fo
466456 // only that it changes in a resize, and when that happens, we want to sync the body to the
467457 // header scroll position
468458 useEffect ( ( ) => {
469- if ( lastResizeInteractionModality . current === 'keyboard' && headerRef . current . contains ( document . activeElement ) ) {
459+ if ( getInteractionModality ( ) === 'keyboard' && headerRef . current . contains ( document . activeElement ) ) {
470460 document . activeElement ?. scrollIntoView ?.( { block : 'nearest' , inline : 'nearest' } ) ;
471461 bodyRef . current . scrollLeft = headerRef . current . scrollLeft ;
472462 }
473- } , [ state . contentSize , headerRef , bodyRef , lastResizeInteractionModality ] ) ;
463+ } , [ state . contentSize , headerRef , bodyRef ] ) ;
474464
475465 let headerHeight = layout . getLayoutInfo ( 'header' ) ?. rect . height || 0 ;
476466 let visibleRect = state . virtualizer . visibleRect ;
@@ -662,7 +652,6 @@ function ResizableTableColumnHeader(props) {
662652 setIsInResizeMode,
663653 isEmpty,
664654 onFocusedResizer,
665- onMoveResizer,
666655 isInResizeMode,
667656 headerMenuOpen,
668657 setHeaderMenuOpen
@@ -807,8 +796,7 @@ function ResizableTableColumnHeader(props) {
807796 onResizeStart = { onResizeStart }
808797 onResize = { onResize }
809798 onResizeEnd = { onResizeEnd }
810- triggerRef = { useUnwrapDOMRef ( triggerRef ) }
811- onMoveResizer = { onMoveResizer } />
799+ triggerRef = { useUnwrapDOMRef ( triggerRef ) } />
812800 < div
813801 aria-hidden
814802 className = { classNames (
0 commit comments