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
Loosing existing selection when adding options not in list #1089
Comments
I have the same issue. In my case, it seems like the component does not run my custom It does not return like the create-option tells it to. Expected result: [
[0]: { fullName: 'John Doe', id: 2 },
[1]: { fullName: 'myCreateOptionItem', id: -1 }
]
//...
selectedValue: -1 Actual result: [
[0]: { fullName: 'John Doe', id: 2 },
[1]: 'myCreateOptionItem',
]
//...
selectedValue: undefined You can see this in this provided CodePen example This issue is not affected in v3.7.0, so probably a break in 3.7.1 |
Locking your version to 3.7.0 solves this issue temporarily @papakay |
Reduce works by taking the 'reduced' value, and finding the complete object within the options list. There's an internal method I haven't tracked down what changed so that this started happening (I assume it has to do with the comparison changing to
|
You are the hero we deserve 🎖 |
I appreciate your great work @sagalbot |
Duplicate #993 |
I have a fix for this ready to go, but there's an issue caused when <v-select
v-model="selected"
:options="[]"
label="label"
taggable
push-tags
:reduce="name => name.value"
:create-option="label => ({ label, value: -1 })"
/> @BlitZz96 you'd get bit by this issue in your example. Now that I'm typing this out I might have a solution...
That should give you the correct value, and then it doesn't matter if |
🎉 This issue has been resolved in version 3.8.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This one should be solved. Let me know if you run into any issues! 🎉 |
Thank you for your time @sagalbot. I figured I did not need |
@BlitZz96 happy to help! I'm signed up for GitHub sponsors https://github.com/sponsors/sagalbot, but I haven't advertised it much. Definitely need to advertise a bit more – I think I'll add the link to the automated release comment, as well as the docs and readme 👍 |
Describe the bug
I have a block of code as below
Everything works when when i select from the list of returned options, however i loose existing when immediately I try to add an option not in list.
Screenshots
Before adding option not in list
After Adding option not in list
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: