Only highlight/focus the item after scrolling has finished (#30888)

This commit is contained in:
David Langley
2025-09-30 09:55:32 +00:00
committed by GitHub
parent 7e48f2b6b6
commit e0df420ade
2 changed files with 21 additions and 1 deletions
+1 -1
View File
@@ -133,13 +133,13 @@ export function ListView<Item, Context = any>(props: IListViewProps<Item, Contex
}
if (items[clampedIndex]) {
const key = getItemKey(items[clampedIndex]);
setTabIndexKey(key);
isScrollingToItem.current = true;
virtuosoHandleRef.current?.scrollIntoView({
index: clampedIndex,
align: align,
behavior: "auto",
done: () => {
setTabIndexKey(key);
isScrollingToItem.current = false;
},
});