From 2b091eea76c6deeb8afb30ba5ef6c180f507f926 Mon Sep 17 00:00:00 2001 From: Maximilian Schoell Date: Tue, 6 Jan 2026 14:07:14 +0100 Subject: [PATCH 1/2] fix: wrap scrollToIndex in requestAnimationFrame --- src/select/parts/virtual-list.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/select/parts/virtual-list.tsx b/src/select/parts/virtual-list.tsx index b59589ac7d..fa2547965f 100644 --- a/src/select/parts/virtual-list.tsx +++ b/src/select/parts/virtual-list.tsx @@ -74,7 +74,10 @@ const VirtualListOpen = forwardRef( menuEl: menuRefObject?.current, }); } else { - scrollToIndex(index); + // Fix for AWSUI-61506. Defer scroll to next frame to ensure + // virtual items are measured after re-render. When called from + // parent's useEffect, measurements may not be ready yet. + requestAnimationFrame(() => scrollToIndex(index)); } } previousHighlightedIndex.current = index; From 831d66c0d6ec992e98e758531a6b0af2301f0bb4 Mon Sep 17 00:00:00 2001 From: Andrei Zhaleznichenka Date: Tue, 6 Jan 2026 17:31:13 +0100 Subject: [PATCH 2/2] Apply suggestion from @pan-kot --- src/select/parts/virtual-list.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/select/parts/virtual-list.tsx b/src/select/parts/virtual-list.tsx index fa2547965f..93b611ef9d 100644 --- a/src/select/parts/virtual-list.tsx +++ b/src/select/parts/virtual-list.tsx @@ -75,7 +75,7 @@ const VirtualListOpen = forwardRef( }); } else { // Fix for AWSUI-61506. Defer scroll to next frame to ensure - // virtual items are measured after re-render. When called from + // virtual items are measured after re-render. When called from // parent's useEffect, measurements may not be ready yet. requestAnimationFrame(() => scrollToIndex(index)); }