Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[Bug Report] If Combobox loses focus with the input string matching an existing term, the saved value is removed. #12351

Closed
jsdbroughton opened this issue Oct 4, 2020 · 2 comments · Fixed by #13366
Assignees
Labels
C: VCombobox VCombobox T: bug Functionality that does not work as intended/expected
Milestone

Comments

@jsdbroughton
Copy link

Environment

Vuetify Version: 2.3.6
Vue Version: 2.6.2
Browsers: Chrome 85.0.4183.121
OS: Mac OS 10.15.7

Steps to reproduce

Add a Tag to multi combobox.
Blur the combobox.
Start typing the same Tag in the combobox input field.
Blur the combobox.

Expected Behavior

Input string clears. Previously entered tag remains.

Actual Behavior

Input string clears. Previously entered tag is removed from the values.

Reproduction Link

https://codepen.io/stardotbmp/pen/YzqmByN?editable=true&editors=101%3Dhttps%3A%2F%2Fvuetifyjs.com%2F

Other comments

With some versions of the combobox props, this behaviour also occurs if the field is cleared with the Escape key.

Some combinations of props/slots exhibit the behaviour where a duplicate tag is added will result in no tag being added and some where the duplicate existing tag is removed. Seems related.

@Dan-Correia
Copy link

Hi @jsdbroughton, I was looking at the source code for the combobox, and the intention seems clear. It's not meant to allow duplicated values.

I went to look for the documentation and the description of the Combobox and here's the description:

image

This is therefore a feature request, not a bug report.

@jsdbroughton
Copy link
Author

That intention is indeed clear. The fact a user may be 'punished' under certain circumstances for entering a duplicate value by having both removed seems buggy more than a feature to be removed.

@jacekkarczmarczyk jacekkarczmarczyk added C: VCombobox VCombobox S: triage T: bug Functionality that does not work as intended/expected and removed S: triage labels Oct 24, 2020
@johnleider johnleider self-assigned this Jun 11, 2021
@johnleider johnleider added this to the v2.5.x milestone Jun 11, 2021
johnleider pushed a commit that referenced this issue Jun 14, 2021
fixes #12351

* fix(VCombobox): correctly handle duplicate items

* fix(VCombobox): copy object beore it is removed

* fix(VCombobox): copy object before it is removed

* chore: resolve merge conflicts

* chore: add deleted changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VCombobox VCombobox T: bug Functionality that does not work as intended/expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants