Skip to content

Commit ccb2401

Browse files
committed
fix: select not scrollTo active position
1 parent 01718e3 commit ccb2401

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

components/vc-select/OptionList.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,9 @@ const OptionList = defineComponent<OptionListProps, { state?: any }>({
151151
const value = Array.from(props.values)[0];
152152
const index = memoFlattenOptions.value.findIndex(({ data }) => data.value === value);
153153
setActive(index);
154-
scrollIntoView(index);
154+
nextTick(() => {
155+
scrollIntoView(index);
156+
});
155157
}
156158
// Force trigger scrollbar visible when open
157159
if (props.open) {

0 commit comments

Comments
 (0)