@@ -94,9 +94,9 @@ interface TableContextValue<T> {
94
94
setIsInResizeMode : ( val : boolean ) => void ,
95
95
isEmpty : boolean ,
96
96
onFocusedResizer : ( ) => void ,
97
- onResizeStart : ( key : Key ) => void ,
97
+ onResizeStart : ( widths : Map < Key , ColumnSize > ) => void ,
98
98
onResize : ( widths : Map < Key , ColumnSize > ) => void ,
99
- onResizeEnd : ( key : Key ) => void ,
99
+ onResizeEnd : ( widths : Map < Key , ColumnSize > ) => void ,
100
100
onMoveResizer : ( e : MoveMoveEvent ) => void ,
101
101
headerMenuOpen : boolean ,
102
102
setHeaderMenuOpen : ( val : boolean ) => void
@@ -114,7 +114,7 @@ export function useVirtualizerContext() {
114
114
115
115
function TableView < T extends object > ( props : SpectrumTableProps < T > , ref : DOMRef < HTMLDivElement > ) {
116
116
props = useProviderProps ( props ) ;
117
- let { isQuiet, onAction, onResizeEnd : propsOnResizeEnd } = props ;
117
+ let { isQuiet, onAction, onResizeStart : propsOnResizeStart , onResizeEnd : propsOnResizeEnd } = props ;
118
118
let { styleProps} = useStyleProps ( props ) ;
119
119
120
120
let [ showSelectionCheckboxes , setShowSelectionCheckboxes ] = useState ( props . selectionStyle !== 'highlight' ) ;
@@ -369,9 +369,10 @@ function TableView<T extends object>(props: SpectrumTableProps<T>, ref: DOMRef<H
369
369
lastResizeInteractionModality . current = undefined ;
370
370
}
371
371
} ;
372
- let onResizeStart = useCallback ( ( ) => {
372
+ let onResizeStart = useCallback ( ( widths ) => {
373
373
setIsResizing ( true ) ;
374
- } , [ setIsResizing ] ) ;
374
+ propsOnResizeStart ?.( widths ) ;
375
+ } , [ setIsResizing , propsOnResizeStart ] ) ;
375
376
let onResizeEnd = useCallback ( ( widths ) => {
376
377
setIsInResizeMode ( false ) ;
377
378
setIsResizing ( false ) ;
@@ -504,7 +505,7 @@ function TableVirtualizer({layout, collection, lastResizeInteractionModality, fo
504
505
let resizerAtEdge = resizerPosition > Math . max ( state . virtualizer . contentSize . width , state . virtualizer . visibleRect . width ) - 3 ;
505
506
// this should be fine, every movement of the resizer causes a rerender
506
507
// scrolling can cause it to lag for a moment, but it's always updated
507
- let resizerInVisibleRegion = resizerPosition < state . virtualizer . visibleRect . width + ( isNaN ( bodyRef . current ?. scrollLeft ) ? 0 : bodyRef . current ?. scrollLeft ) ;
508
+ let resizerInVisibleRegion = resizerPosition < state . virtualizer . visibleRect . maxX ;
508
509
let shouldHardCornerResizeCorner = resizerAtEdge && resizerInVisibleRegion ;
509
510
510
511
// minimize re-render caused on Resizers by memoing this
0 commit comments