@@ -26,10 +26,12 @@ export class TableLayout<T> extends ListLayout<T> {
2626 isLoading = false ;
2727 lastPersistedKeys : Set < Key > = null ;
2828 persistedIndices : Map < Key , number [ ] > = new Map ( ) ;
29+ private disableSticky : boolean ;
2930
3031 constructor ( options : ListLayoutOptions < T > ) {
3132 super ( options ) ;
3233 this . stickyColumnIndices = [ ] ;
34+ this . disableSticky = this . checkChrome105 ( ) ;
3335 }
3436
3537
@@ -166,7 +168,7 @@ export class TableLayout<T> extends ListLayout<T> {
166168 let { height, isEstimated} = this . getEstimatedHeight ( node , width , this . headingHeight , this . estimatedHeadingHeight ) ;
167169 let rect = new Rect ( x , y , width , height ) ;
168170 let layoutInfo = new LayoutInfo ( node . type , node . key , rect ) ;
169- layoutInfo . isSticky = node . props ?. isSelectionCell ;
171+ layoutInfo . isSticky = ! this . disableSticky && node . props ?. isSelectionCell ;
170172 layoutInfo . zIndex = layoutInfo . isSticky ? 2 : 1 ;
171173 layoutInfo . estimatedSize = isEstimated ;
172174
@@ -195,7 +197,7 @@ export class TableLayout<T> extends ListLayout<T> {
195197 let rect = new Rect ( 40 , Math . max ( y , 40 ) , ( width || this . virtualizer . visibleRect . width ) - 80 , children . length === 0 ? this . virtualizer . visibleRect . height - 80 : 60 ) ;
196198 let loader = new LayoutInfo ( 'loader' , 'loader' , rect ) ;
197199 loader . parentKey = 'body' ;
198- loader . isSticky = children . length === 0 ;
200+ loader . isSticky = ! this . disableSticky && children . length === 0 ;
199201 this . layoutInfos . set ( 'loader' , loader ) ;
200202 children . push ( { layoutInfo : loader } ) ;
201203 y = loader . rect . maxY ;
@@ -204,7 +206,7 @@ export class TableLayout<T> extends ListLayout<T> {
204206 let rect = new Rect ( 40 , Math . max ( y , 40 ) , this . virtualizer . visibleRect . width - 80 , this . virtualizer . visibleRect . height - 80 ) ;
205207 let empty = new LayoutInfo ( 'empty' , 'empty' , rect ) ;
206208 empty . parentKey = 'body' ;
207- empty . isSticky = true ;
209+ empty . isSticky = ! this . disableSticky ;
208210 this . layoutInfos . set ( 'empty' , empty ) ;
209211 children . push ( { layoutInfo : empty } ) ;
210212 y = empty . rect . maxY ;
@@ -267,7 +269,7 @@ export class TableLayout<T> extends ListLayout<T> {
267269 let { height, isEstimated} = this . getEstimatedHeight ( node , width , this . rowHeight , this . estimatedRowHeight ) ;
268270 let rect = new Rect ( x , y , width , height ) ;
269271 let layoutInfo = new LayoutInfo ( node . type , node . key , rect ) ;
270- layoutInfo . isSticky = node . props ?. isSelectionCell ;
272+ layoutInfo . isSticky = ! this . disableSticky && node . props ?. isSelectionCell ;
271273 layoutInfo . zIndex = layoutInfo . isSticky ? 2 : 1 ;
272274 layoutInfo . estimatedSize = isEstimated ;
273275
@@ -440,4 +442,22 @@ export class TableLayout<T> extends ListLayout<T> {
440442
441443 return res ;
442444 }
445+
446+ // Checks if Chrome version is 105 or greater
447+ private checkChrome105 ( ) {
448+ if ( typeof window === 'undefined' || window . navigator == null ) {
449+ return false ;
450+ }
451+
452+ let isChrome105 ;
453+ if ( window . navigator [ 'userAgentData' ] ) {
454+ isChrome105 = window . navigator [ 'userAgentData' ] ?. brands . some ( b => b . brand === 'Chromium' && Number ( b . version ) >= 105 ) ;
455+ } else {
456+ let regex = / C h r o m e \/ ( \d + ) / ;
457+ let matches = regex . exec ( window . navigator . userAgent ) ;
458+ isChrome105 = matches && matches . length >= 2 && Number ( matches [ 1 ] ) >= 105 ;
459+ }
460+
461+ return isChrome105 ;
462+ }
443463}
0 commit comments