@@ -25,7 +25,8 @@ export type ListLayoutOptions<T> = {
25
25
collator ?: Intl . Collator ,
26
26
loaderHeight ?: number ,
27
27
placeholderHeight ?: number ,
28
- allowDisabledKeyFocus ?: boolean
28
+ allowDisabledKeyFocus ?: boolean ,
29
+ forceSectionHeaders ?: boolean
29
30
} ;
30
31
31
32
// A wrapper around LayoutInfo that supports hierarchy
@@ -59,6 +60,7 @@ export class ListLayout<T> extends Layout<Node<T>, ListLayoutProps> implements K
59
60
protected estimatedRowHeight : number ;
60
61
protected headingHeight : number ;
61
62
protected estimatedHeadingHeight : number ;
63
+ protected forceSectionHeaders : boolean ;
62
64
protected padding : number ;
63
65
protected indentationForItem ?: ( collection : Collection < Node < T > > , key : Key ) => number ;
64
66
protected layoutInfos : Map < Key , LayoutInfo > ;
@@ -88,6 +90,7 @@ export class ListLayout<T> extends Layout<Node<T>, ListLayoutProps> implements K
88
90
this . estimatedRowHeight = options . estimatedRowHeight ;
89
91
this . headingHeight = options . headingHeight ;
90
92
this . estimatedHeadingHeight = options . estimatedHeadingHeight ;
93
+ this . forceSectionHeaders = options . forceSectionHeaders ;
91
94
this . padding = options . padding || 0 ;
92
95
this . indentationForItem = options . indentationForItem ;
93
96
this . collator = options . collator ;
@@ -310,7 +313,7 @@ export class ListLayout<T> extends Layout<Node<T>, ListLayoutProps> implements K
310
313
buildSection ( node : Node < T > , x : number , y : number ) : LayoutNode {
311
314
let width = this . virtualizer . visibleRect . width ;
312
315
let header = null ;
313
- if ( node . rendered ) {
316
+ if ( node . rendered || this . forceSectionHeaders ) {
314
317
let headerNode = this . buildHeader ( node , x , y ) ;
315
318
header = headerNode . layoutInfo ;
316
319
header . key += ':header' ;
0 commit comments