-
-
Notifications
You must be signed in to change notification settings - Fork 489
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
Select fails to change value on first try. #3014
Comments
Interesting combination @natankeddem. It works if you use |
I was basically trying to recreate the example on the Quasar site: |
@natankeddem the Quasar example does not have a preselection of values... |
Minimum reproduction: options = ['default']
ui.select(options, value=options, with_input=True, new_value_mode='add', multiple=True).props('use-chips') Working counterexample: ui.select(['default'], value=['default'], with_input=True, new_value_mode='add', multiple=True).props('use-chips') I guess there is a problem with using the same reference for the options and the value. Maybe we can simply copy on of the arguments. I'll look into it. |
Actually I'm not sure if we really need to change the implementation by copying arguments. Maybe we should warn or raise instead if both arguments are the same object, because that doesn't make much sense and the expected behavior is not very clear. |
@falkoschindler thank you so much for digging into this so quickly. @rodja and your commitment to this project is exceptional. Your breakdown of the core issue makes sense, the options and value somehow are interacting strangely when they are sharing a list. In my use case I was attempting to restore the value and options from storage at startup. That is why both objects were the same. I don't have an opinion on the best resolution on this issue, I'll defer to yours. |
Description
I am testing the following code:
Here is a video of my experience:
google_screen_recording_2024-05-04T02-39_11.781Z.webm
You will note the first entry disappears on submission and I must retype the name and submit it again to get it to change value.
The text was updated successfully, but these errors were encountered: