diff --git a/uui-components/src/pickers/hooks/usePickerInput.ts b/uui-components/src/pickers/hooks/usePickerInput.ts index 4009178a47..c3a42a8bbe 100644 --- a/uui-components/src/pickers/hooks/usePickerInput.ts +++ b/uui-components/src/pickers/hooks/usePickerInput.ts @@ -93,13 +93,14 @@ export function usePickerInput(props: UsePickerInputProps ({ + ...prevState, topIndex: 0, visibleCount: initialRowsVisible, focusedIndex: 0, + scrollTo: undefined, search: '', - }); + })); setIsSearchChanged(false); setOpened(newOpened); diff --git a/uui-core/src/hooks/useVirtualList/utils.ts b/uui-core/src/hooks/useVirtualList/utils.ts index 5c1c706872..424a9025f6 100644 --- a/uui-core/src/hooks/useVirtualList/utils.ts +++ b/uui-core/src/hooks/useVirtualList/utils.ts @@ -113,7 +113,7 @@ const getRealBottomIndex = ({ rowsCount, scrollContainer, rowOffsets, value: { t let bottomIndex = topIndex; const containerScrollTop = scrollContainer?.scrollTop ?? 0; - const containerScrollBottom = containerScrollTop + scrollContainer.clientHeight ?? 0; + const containerScrollBottom = containerScrollTop + scrollContainer?.clientHeight ?? 0; while (bottomIndex < rowsCount && rowOffsets[bottomIndex] < containerScrollBottom) { bottomIndex++; }