Skip to content

Commit

Permalink
fix(VCombobox): prevent removing disabled items with backspace (#18300)
Browse files Browse the repository at this point in the history
fixes #18298
  • Loading branch information
gitemad authored Sep 25, 2023
1 parent 305a211 commit d49184b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ export const VAutocomplete = genericComponent<new <
const originalSelectionIndex = selectionIndex.value

const selectedItem = model.value[selectionIndex.value]
if (selectedItem) select(selectedItem)
if (selectedItem && !selectedItem.props.disabled) select(selectedItem)

selectionIndex.value = originalSelectionIndex >= length - 1 ? (length - 2) : originalSelectionIndex
}
Expand Down
2 changes: 1 addition & 1 deletion packages/vuetify/src/components/VCombobox/VCombobox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ export const VCombobox = genericComponent<new <

const originalSelectionIndex = selectionIndex.value
const selectedItem = model.value[selectionIndex.value]
if (selectedItem) select(selectedItem)
if (selectedItem && !selectedItem.props.disabled) select(selectedItem)

selectionIndex.value = originalSelectionIndex >= length - 1 ? (length - 2) : originalSelectionIndex
}
Expand Down

0 comments on commit d49184b

Please sign in to comment.