fix: select not scrollTo active position

pull/4499/head
tangjinzhou 2021-08-11 16:59:39 +08:00
parent 01718e35ba
commit ccb24016c0
1 changed files with 3 additions and 1 deletions

View File

@ -151,7 +151,9 @@ const OptionList = defineComponent<OptionListProps, { state?: any }>({
const value = Array.from(props.values)[0];
const index = memoFlattenOptions.value.findIndex(({ data }) => data.value === value);
setActive(index);
scrollIntoView(index);
nextTick(() => {
scrollIntoView(index);
});
}
// Force trigger scrollbar visible when open
if (props.open) {