Skip to content

QSelect name prop is not added when initial modelValue is null #17951

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

Open
cmcleese opened this issue Apr 4, 2025 · 2 comments
Open

QSelect name prop is not added when initial modelValue is null #17951

cmcleese opened this issue Apr 4, 2025 · 2 comments
Labels
area/components bug/1-repro-available A reproduction is available and needs to be confirmed. flavour/quasar-cli-vite kind/bug 🐞 Qv2 🔝 Quasar v2 issues

Comments

@cmcleese
Copy link

cmcleese commented Apr 4, 2025

What happened?

When the modelValue for QSelect inits as null then there is no hidden element and thus no name prop added.
This can be problematic when you added the prop :name but its not present in the dom. Especially for validation purposes.

Image

What did you expect to happen?

Regardless of null value, the name prop should always be present on the component.

Reproduction URL

https://codepen.io/cmcleese/pen/XJWGNdG?editors=101

How to reproduce?

  1. Input both components
  2. Notice the first which has a start value of null has no name present on any component in the dom

Flavour

Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)

Areas

Components (quasar)

Platforms/Browsers

No response

Quasar info output

Relevant log output

Additional context

No response

@cmcleese cmcleese added kind/bug 🐞 Qv2 🔝 Quasar v2 issues labels Apr 4, 2025
@github-actions github-actions bot added area/components bug/1-repro-available A reproduction is available and needs to be confirmed. flavour/quasar-cli-vite labels Apr 4, 2025
@ahmedjas1m
Copy link
Contributor

passing an empty string '' i mean ref('') can solve your problem but it happens again because @clear emits null by default. i am looking at the source for a better understanding

@ahmedjas1m
Copy link
Contributor

ahmedjas1m commented May 4, 2025

@cmcleese something like this in the DOM would be handy ? (while passing null)
<select class="hidden" name="fullName"><option selected="" value=""></option></select>

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/quasar-cli-vite kind/bug 🐞 Qv2 🔝 Quasar v2 issues
Projects
None yet
Development

No branches or pull requests

2 participants