Skip to content

Commit e5a0928

Browse files
authored
fix: scroll end in virtualized listbox story (adobe#9864)
* fix: story scroll end * chore: revert oopsie * chore: typo
1 parent c5a3ae8 commit e5a0928

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/react-aria-components/stories/ListBox.stories.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,8 @@ function generateRandomString(minLength: number, maxLength: number): string {
353353

354354
function VirtualizedListBoxRender(args): JSX.Element {
355355
let {variableHeight, isLoading, orientation} = args;
356+
let estimatedRowHeight = orientation === 'horizontal' ? 117 : 25;
357+
let estimatedHeadingHeight = orientation === 'horizontal' ? 63 : 26;
356358
let heightProperty = orientation === 'horizontal' ? 'width' : 'height';
357359
let widthProperty = orientation === 'horizontal' ? 'height' : 'width';
358360
let sections: {id: string, name: string, children: {id: string, name: string}[]}[] = [];
@@ -369,8 +371,8 @@ function VirtualizedListBoxRender(args): JSX.Element {
369371
<Virtualizer
370372
layout={new ListLayout({
371373
orientation,
372-
estimatedRowHeight: 25,
373-
estimatedHeadingHeight: 26,
374+
estimatedRowHeight,
375+
estimatedHeadingHeight,
374376
loaderHeight: 30
375377
})}>
376378
<ListBox orientation={orientation} className={styles.menu} style={{[heightProperty]: 400, [widthProperty]: 200}} aria-label="virtualized listbox">

0 commit comments

Comments
 (0)