Skip to content

Commit adb2597

Browse files
committed
fix(VSelect/VAutocomplete/VCombobox): respect no-auto-scroll
fixes #22920
1 parent c1ef7fa commit adb2597

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

packages/vuetify/src/components/VAutocomplete/VAutocomplete.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ export const VAutocomplete = genericComponent<new <
461461
const index = displayItems.value.findIndex(
462462
item => model.value.some(s => item.value === s.value)
463463
)
464-
IN_BROWSER && window.requestAnimationFrame(() => {
464+
IN_BROWSER && !props.noAutoScroll && window.requestAnimationFrame(() => {
465465
index >= 0 && vVirtualScrollRef.value?.scrollToIndex(index)
466466
})
467467
}

packages/vuetify/src/components/VCombobox/VCombobox.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ export const VCombobox = genericComponent<new <
523523
const index = displayItems.value.findIndex(
524524
item => model.value.some(s => (props.valueComparator || deepEqual)(s.value, item.value))
525525
)
526-
IN_BROWSER && window.requestAnimationFrame(() => {
526+
IN_BROWSER && !props.noAutoScroll && window.requestAnimationFrame(() => {
527527
index >= 0 && vVirtualScrollRef.value?.scrollToIndex(index)
528528
})
529529
}

packages/vuetify/src/components/VSelect/VSelect.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ export const VSelect = genericComponent<new <
398398
}
399399
if (listRef.value && isFocused.value) {
400400
const index = getSelectedFocusableIndex()
401-
listRef.value.focus(index >= 0 ? index : 'first', { focusVisible: false })
401+
listRef.value.focus(index >= 0 ? index : 'first', { focusVisible: false, preventScroll: props.noAutoScroll })
402402
}
403403
}
404404
function onAfterLeave () {

0 commit comments

Comments
 (0)