@@ -25,7 +25,8 @@ export type ListLayoutOptions<T> = {
2525 collator ?: Intl . Collator ,
2626 loaderHeight ?: number ,
2727 placeholderHeight ?: number ,
28- allowDisabledKeyFocus ?: boolean
28+ allowDisabledKeyFocus ?: boolean ,
29+ forceSectionHeaders ?: boolean
2930} ;
3031
3132// A wrapper around LayoutInfo that supports hierarchy
@@ -59,6 +60,7 @@ export class ListLayout<T> extends Layout<Node<T>, ListLayoutProps> implements K
5960 protected estimatedRowHeight : number ;
6061 protected headingHeight : number ;
6162 protected estimatedHeadingHeight : number ;
63+ protected forceSectionHeaders : boolean ;
6264 protected padding : number ;
6365 protected indentationForItem ?: ( collection : Collection < Node < T > > , key : Key ) => number ;
6466 protected layoutInfos : Map < Key , LayoutInfo > ;
@@ -88,6 +90,7 @@ export class ListLayout<T> extends Layout<Node<T>, ListLayoutProps> implements K
8890 this . estimatedRowHeight = options . estimatedRowHeight ;
8991 this . headingHeight = options . headingHeight ;
9092 this . estimatedHeadingHeight = options . estimatedHeadingHeight ;
93+ this . forceSectionHeaders = options . forceSectionHeaders ;
9194 this . padding = options . padding || 0 ;
9295 this . indentationForItem = options . indentationForItem ;
9396 this . collator = options . collator ;
@@ -310,7 +313,7 @@ export class ListLayout<T> extends Layout<Node<T>, ListLayoutProps> implements K
310313 buildSection ( node : Node < T > , x : number , y : number ) : LayoutNode {
311314 let width = this . virtualizer . visibleRect . width ;
312315 let header = null ;
313- if ( node . rendered ) {
316+ if ( node . rendered || this . forceSectionHeaders ) {
314317 let headerNode = this . buildHeader ( node , x , y ) ;
315318 header = headerNode . layoutInfo ;
316319 header . key += ':header' ;
0 commit comments