@@ -286,7 +286,7 @@ function TableViewBase<T extends object>(props: TableBaseProps<T>, ref: DOMRef<H
286
286
// This overrides collection view's renderWrapper to support DOM hierarchy.
287
287
type View = ReusableView < GridNode < T > , ReactNode > ;
288
288
let renderWrapper = ( parent : View , reusableView : View , children : View [ ] , renderChildren : ( views : View [ ] ) => ReactElement [ ] ) => {
289
- let style = layoutInfoToStyle ( reusableView . layoutInfo , direction , parent ?. layoutInfo , reusableView . virtualizer . contentSize ) ;
289
+ let style = layoutInfoToStyle ( reusableView . layoutInfo , direction , parent ?. layoutInfo , reusableView . virtualizer . visibleRect ) ;
290
290
if ( style . overflow === 'hidden' ) {
291
291
style . overflow = 'visible' ; // needed to support position: sticky
292
292
}
@@ -620,10 +620,11 @@ function TableVirtualizer(props) {
620
620
621
621
let resizerPosition = layout . getResizerPosition ( ) - 2 ;
622
622
623
- let resizerAtEdge = resizerPosition > Math . max ( state . virtualizer . contentSize . width , state . virtualizer . visibleRect . width ) - 3 ;
623
+ let visibleRect = state . virtualizer . visibleRect ;
624
+ let resizerAtEdge = resizerPosition > Math . max ( state . virtualizer . contentSize . width , visibleRect . width ) - 3 ;
624
625
// this should be fine, every movement of the resizer causes a rerender
625
626
// scrolling can cause it to lag for a moment, but it's always updated
626
- let resizerInVisibleRegion = resizerPosition < state . virtualizer . visibleRect . maxX ;
627
+ let resizerInVisibleRegion = resizerPosition < visibleRect . maxX ;
627
628
let shouldHardCornerResizeCorner = resizerAtEdge && resizerInVisibleRegion ;
628
629
629
630
// minimize re-render caused on Resizers by memoing this
@@ -655,7 +656,14 @@ function TableVirtualizer(props) {
655
656
transition : state . isAnimating ? `none ${ state . virtualizer . transitionDuration } ms` : undefined
656
657
} }
657
658
ref = { headerRef } >
658
- { state . visibleViews [ 0 ] }
659
+ < div
660
+ role = "presentation"
661
+ style = { {
662
+ width : state . contentSize . width === visibleRect . width ? undefined : state . contentSize . width ,
663
+ height : headerHeight
664
+ } } >
665
+ { state . visibleViews [ 0 ] }
666
+ </ div >
659
667
</ div >
660
668
< ScrollView
661
669
role = "presentation"
0 commit comments