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

Select, use-input in add mode select current value on enter if option menu is open #16514

Open
derpierre65 opened this issue Oct 24, 2023 · 2 comments
Labels
area/components bug/1-repro-available A reproduction is available and needs to be confirmed. flavour/vite-plugin Bugs related to Vite usage with Quasar kind/bug 🐞 Qv2 🔝 Quasar v2 issues

Comments

@derpierre65
Copy link

What happened?

I have a q-select with use-input, new-value-mode="add-unique", a v-model and an options array
if i press enter to submit my new value while the option menu is open and my current value is visible in the menu then the current value will be selected instead of my new value will be submitted.
new-value will not be emitted too.

Also happen in quasar v1
Video example: https://streamable.com/27xjru

What did you expect to happen?

My new value should be set into my v-model.

Reproduction URL

https://jsfiddle.net/vh7f1aL5/2/

How to reproduce?

  • create a q-select with use-input, new-value-mode="add-unique", a v-model and an options array
  • the v-model value must be a value of your options array
  • click in select field, your options menu should be open
  • enter any text
  • press enter
  • input will cleared, new value will not be set.

Flavour

Vite Plugin (@quasar/vite-plugin)

Areas

Components (quasar)

Platforms/Browsers

Firefox, Chrome

Quasar info output

No response

Relevant log output

No response

Additional context

No response

@github-actions github-actions bot added area/components bug/1-repro-available A reproduction is available and needs to be confirmed. flavour/vite-plugin Bugs related to Vite usage with Quasar labels Oct 24, 2023
@pdanpdan
Copy link
Collaborator

pdanpdan commented Oct 24, 2023

If an option is selected in the list than that option will be selected on enter. So you have to press UP ARROW to unselect the option (or ESC to close the menu). Or if you filter the options then it will auto remove the option from the list.

Maybe someone can come with a good way to decide when to have the option selected and when not.

@derpierre65
Copy link
Author

i know that this would fix that but it is not a good solution for the normal user.
if i filter my entries, it could happen that my selected entry is also included in my list so that would be trigger the issue again

my first idea is:

  • if the user enter something in the input field then enter should submit my value
  • if the user start using arrow keys and press enter the selected entry in the list should be selected until he start typing again into the input text

I hope that was understandable how I mean that

pdanpdan added a commit to pdanpdan/quasar that referenced this issue Oct 26, 2023
pdanpdan added a commit to pdanpdan/quasar that referenced this issue Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/components bug/1-repro-available A reproduction is available and needs to be confirmed. flavour/vite-plugin Bugs related to Vite usage with Quasar kind/bug 🐞 Qv2 🔝 Quasar v2 issues
Projects
None yet
Development

No branches or pull requests

2 participants