From 41307707049e429ae843469aed0790d5bd96fbd9 Mon Sep 17 00:00:00 2001 From: TkDodo Date: Wed, 24 Jun 2026 20:56:37 +0200 Subject: [PATCH 1/3] fix(listBox): fix virtualized scrolling when mouse is used apparently, listState.selectionManager.focuseKey is empty string in those cases. The effect that scrolls elements into view was only meant for keyboard navigation, but it effectively stopped scrolling on virtualized lists when the scrollbar is dragged because it always instantly scrolls back to the focused element. the fix is to widen the early return statement to include empty string --- static/app/components/core/compactSelect/listBox/index.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/static/app/components/core/compactSelect/listBox/index.tsx b/static/app/components/core/compactSelect/listBox/index.tsx index e75c241ce8283a..68b5dcb7311bb8 100644 --- a/static/app/components/core/compactSelect/listBox/index.tsx +++ b/static/app/components/core/compactSelect/listBox/index.tsx @@ -192,7 +192,11 @@ export function ListBox({ }); useEffect(() => { - if (!virtualized || listState.selectionManager.focusedKey === null) { + if ( + !virtualized || + listState.selectionManager.focusedKey === null || + listState.selectionManager.focusedKey === '' + ) { return; } From ad5dc079a01460dc17269139346f030fa88b2c44 Mon Sep 17 00:00:00 2001 From: TkDodo Date: Thu, 25 Jun 2026 09:24:38 +0200 Subject: [PATCH 2/3] fix: bail out of scrollIntoView effect when not interacting with the keyboard the effect was meant for cmd-k keyboard navigation and should not have an impact on scrolling with the mouse / dragging the scrollbar --- static/app/components/core/compactSelect/listBox/index.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/static/app/components/core/compactSelect/listBox/index.tsx b/static/app/components/core/compactSelect/listBox/index.tsx index 68b5dcb7311bb8..564e4bc01dd60c 100644 --- a/static/app/components/core/compactSelect/listBox/index.tsx +++ b/static/app/components/core/compactSelect/listBox/index.tsx @@ -1,4 +1,5 @@ import {Fragment, useEffect, useMemo, useRef, useState} from 'react'; +import {getInteractionModality} from '@react-aria/interactions'; import type {AriaListBoxOptions} from '@react-aria/listbox'; import {useListBox} from '@react-aria/listbox'; import {mergeProps, mergeRefs} from '@react-aria/utils'; @@ -195,7 +196,7 @@ export function ListBox({ if ( !virtualized || listState.selectionManager.focusedKey === null || - listState.selectionManager.focusedKey === '' + getInteractionModality() !== 'keyboard' ) { return; } From 1dcea8d1155eaef0268437ef553ee51d10d8a159 Mon Sep 17 00:00:00 2001 From: TkDodo Date: Thu, 25 Jun 2026 09:54:36 +0200 Subject: [PATCH 3/3] fix: only bail out for pointer (mouse). this includes keyboard and virtual (for screen reader navigation) for auto focus --- static/app/components/core/compactSelect/listBox/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/app/components/core/compactSelect/listBox/index.tsx b/static/app/components/core/compactSelect/listBox/index.tsx index 564e4bc01dd60c..a812f261c47011 100644 --- a/static/app/components/core/compactSelect/listBox/index.tsx +++ b/static/app/components/core/compactSelect/listBox/index.tsx @@ -196,7 +196,7 @@ export function ListBox({ if ( !virtualized || listState.selectionManager.focusedKey === null || - getInteractionModality() !== 'keyboard' + getInteractionModality() === 'pointer' ) { return; }