Skip to content

Commit

Permalink
fix: select not scrollTo active position
Browse files Browse the repository at this point in the history
  • Loading branch information
tangjinzhou committed Aug 11, 2021
1 parent 01718e3 commit ccb2401
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/vc-select/OptionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit ccb2401

Please sign in to comment.