@@ -26,10 +26,12 @@ export class TableLayout<T> extends ListLayout<T> {
26
26
isLoading = false ;
27
27
lastPersistedKeys : Set < Key > = null ;
28
28
persistedIndices : Map < Key , number [ ] > = new Map ( ) ;
29
+ private disableSticky : boolean ;
29
30
30
31
constructor ( options : ListLayoutOptions < T > ) {
31
32
super ( options ) ;
32
33
this . stickyColumnIndices = [ ] ;
34
+ this . disableSticky = this . checkChrome105 ( ) ;
33
35
}
34
36
35
37
@@ -166,7 +168,7 @@ export class TableLayout<T> extends ListLayout<T> {
166
168
let { height, isEstimated} = this . getEstimatedHeight ( node , width , this . headingHeight , this . estimatedHeadingHeight ) ;
167
169
let rect = new Rect ( x , y , width , height ) ;
168
170
let layoutInfo = new LayoutInfo ( node . type , node . key , rect ) ;
169
- layoutInfo . isSticky = node . props ?. isSelectionCell ;
171
+ layoutInfo . isSticky = ! this . disableSticky && node . props ?. isSelectionCell ;
170
172
layoutInfo . zIndex = layoutInfo . isSticky ? 2 : 1 ;
171
173
layoutInfo . estimatedSize = isEstimated ;
172
174
@@ -195,7 +197,7 @@ export class TableLayout<T> extends ListLayout<T> {
195
197
let rect = new Rect ( 40 , Math . max ( y , 40 ) , ( width || this . virtualizer . visibleRect . width ) - 80 , children . length === 0 ? this . virtualizer . visibleRect . height - 80 : 60 ) ;
196
198
let loader = new LayoutInfo ( 'loader' , 'loader' , rect ) ;
197
199
loader . parentKey = 'body' ;
198
- loader . isSticky = children . length === 0 ;
200
+ loader . isSticky = ! this . disableSticky && children . length === 0 ;
199
201
this . layoutInfos . set ( 'loader' , loader ) ;
200
202
children . push ( { layoutInfo : loader } ) ;
201
203
y = loader . rect . maxY ;
@@ -204,7 +206,7 @@ export class TableLayout<T> extends ListLayout<T> {
204
206
let rect = new Rect ( 40 , Math . max ( y , 40 ) , this . virtualizer . visibleRect . width - 80 , this . virtualizer . visibleRect . height - 80 ) ;
205
207
let empty = new LayoutInfo ( 'empty' , 'empty' , rect ) ;
206
208
empty . parentKey = 'body' ;
207
- empty . isSticky = true ;
209
+ empty . isSticky = ! this . disableSticky ;
208
210
this . layoutInfos . set ( 'empty' , empty ) ;
209
211
children . push ( { layoutInfo : empty } ) ;
210
212
y = empty . rect . maxY ;
@@ -267,7 +269,7 @@ export class TableLayout<T> extends ListLayout<T> {
267
269
let { height, isEstimated} = this . getEstimatedHeight ( node , width , this . rowHeight , this . estimatedRowHeight ) ;
268
270
let rect = new Rect ( x , y , width , height ) ;
269
271
let layoutInfo = new LayoutInfo ( node . type , node . key , rect ) ;
270
- layoutInfo . isSticky = node . props ?. isSelectionCell ;
272
+ layoutInfo . isSticky = ! this . disableSticky && node . props ?. isSelectionCell ;
271
273
layoutInfo . zIndex = layoutInfo . isSticky ? 2 : 1 ;
272
274
layoutInfo . estimatedSize = isEstimated ;
273
275
@@ -440,4 +442,22 @@ export class TableLayout<T> extends ListLayout<T> {
440
442
441
443
return res ;
442
444
}
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
+ }
443
463
}
0 commit comments