-
Notifications
You must be signed in to change notification settings - Fork 592
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
Missing USelectMenu selected option name #1780
Missing USelectMenu selected option name #1780
Comments
Would you mind look what version of |
Reading the changes, this version was indeed a good fix candidate. Unfortunately, both my local / repro were already on |
Not sure this is the cause but in your reproduction, |
Indeed good catch, I updated the reproduction so it's not an array anymore. It doesn't fix the issue though. |
I see the issue, when using a
options are empty. It can be fixed by using the computed options (results of async search) but since the search function watches the q , the options will change and at some point the modelValue will disappear.
Let me know if my explanation isn't clear. |
It is what I understood, in my project I wrote an high order component that keep the value of the selected option. It works but it feels kind of hacky. I had a similar issue when I made a tag list component using the SelectMenu as a base. The badges, representing the selected options, were disappearing when the option list was updated. It would be a pleasure to help fix this issue but I honestly don't have the time do to so, at least not for the upcoming weeks. Maybe mentioning this caveat in the documentation would be a good idea? |
I'll fix part of it so the |
I am experiencing the same issue with @benjamincanac Can you please also fix it there? 🙏 |
Sure, it will be fixed at the same time! |
Hi @benjamincanac please has this been fixed because I am experiencing the same error with both USelectMenu and UInputMenu. I realize if I specify a specific value attribute the display does not work... however if not specified... and an object is returned, the display works fine |
Ok here Is a test I wrote using an example from the docs
I dont know if it is possible to just set the value of a first value to the actual selected object(in this case the userobject from the api) and then using a conditional watch function or maybe a debounce function to set the model value to the value attribute if it is set or the default selected object... This error still persist. Please note that I am currently using the nuxt ui edge. Thank you |
And in the spirit of taking my own advice
|
@benjamincanac Ow and I also noticed that searchLazy and debounce on both the selectmenu and inputmenu are not working |
@Nyantekyi Are you trying the |
Yes please... I was using the edge package... I saw your post that about the edge update... |
Ow and @benjamincanac ... Ive been looking and patiently waiting on ui 3... can I help at least with the testing phase... I am currently writing an app that I know ui3 would be perfect for |
@Nyantekyi Not sure to understand, you're saying there is an issue with the latest Edge package? 🤔 |
Yes.... I am saying the error reported here still exist. As in As per the docs when valueAttribute and optionAttribute is set with an async search function, and/or with debounce... an error occurs where option attribute does not work, however value attribute works. |
I even thought it was because it was because of the compatibilityDate, however even after changing it ... same results |
Would you be able to provide a reproduction? |
@Nyantekyi I don't see the issue in your reproduction, you can remove the |
this is what happens when a value is selected . the selected element's name as selected in the option attribute does not appear.... @benjamincanac |
The |
really
Please help me...how do I fix this |
You can remove the |
I did that already and I still have the same issue... |
… async search Resolves nuxt#1780
Environment
Version
v2.16.0
Reproduction
https://stackblitz.com/edit/nuxt-ui-ntqist?file=app.vue
Description
This bug arises when you use a search function and want a specific value attribute.
The reproduction is mainly the documentation example for async search (https://ui.nuxt.com/components/select-menu#async-search) but with two changes:
multiple
has been removedvalue-attribute="id"
has been addedNow, when an option is selected, its name doesn't appear anymore.
Of course, the goal here is to only assign the
id
to thev-model
, that's why I added thevalue-attribute="id"
. Without, the entire object is being assigned to thev-model
.Additional context
Additionaly, I should probably write another issue (and will do if needed), but just adding
by="id"
in the reproduction shows another weird behavior. This time, everything is shown as "selected".Logs
No response
The text was updated successfully, but these errors were encountered: