Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix(VAutocomplete): reset selection index to -1 after deletion #20836

Closed
wants to merge 1 commit into from

Conversation

TIM56887
Copy link
Contributor

@TIM56887 TIM56887 commented Jan 5, 2025

Description

fixes #20796
Reset selectionIndex to -1 after using Backspace or Delete

Markup:

<template>
  <v-autocomplete
    :items="['California', 'Colorado', 'Florida', 'Georgia', 'Texas', 'Wyoming']"
    label="Autocomplete"
    multiple
  />
</template>

select(model.value[selectionIndex.value], false)

selectionIndex.value = originalSelectionIndex >= length - 1 ? (length - 2) : originalSelectionIndex
selectionIndex.value = -1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will I be unable to perform continuous deletions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @babu-ch,

Yes, after this change, it will be unable to perform continuous deletions directly with a single backspace press. But can still delete by pressing backspace twice.

@KaelWD KaelWD closed this in 2cab7e4 Jan 16, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
2 participants