fix: scroll the listbox into viewport before the search box is shown (#1865)

This commit is contained in:
Quan Ho
2025-12-08 12:42:12 +01:00
committed by GitHub
parent 3287508baa
commit 8dcd87d0ba

View File

@@ -200,6 +200,13 @@ function ListBoxInline({ options, layout }) {
const handleShowSearch = () => {
const newValue = !showSearch;
setShowSearch(newValue);
if (newValue && containerRef.current?.scrollIntoView) {
containerRef.current.scrollIntoView({
block: 'nearest',
inline: 'nearest',
behavior: 'instant',
});
}
};
const onCtrlF = () => {