Skip to content

Commit 4dcdb39

Browse files
authored
revert: "fix: wrap scrollToIndex in requestAnimationFrame (#4132)" (#4133)
1 parent 8b1948a commit 4dcdb39

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/select/parts/virtual-list.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,15 @@ const VirtualListOpen = forwardRef(
7373
menuEl: menuRefObject?.current,
7474
});
7575
} else {
76-
// Fix for AWSUI-61506. Defer scroll to next frame to ensure
77-
// virtual items are measured after re-render. When called from
78-
// parent's useEffect, measurements may not be ready yet.
79-
requestAnimationFrame(() => scrollToIndex(index));
76+
scrollToIndex(index);
8077
}
8178
}
8279
previousHighlightedIndex.current = index;
8380
},
8481
[firstOptionSticky, highlightType.moveFocus, scrollToIndex]
8582
);
8683

87-
const stickySize = firstOptionSticky ? (virtualItems[0]?.size ?? 0) : 0;
84+
const stickySize = firstOptionSticky ? virtualItems[0].size : 0;
8885
const withScrollbar = !!width && width.inner < width.outer;
8986

9087
const idPrefix = useUniqueId('select-list-');

0 commit comments

Comments
 (0)