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

[Bug]: Select emits wrong value for numeric values when in form #1517

Closed
kilobyte2007 opened this issue Dec 20, 2024 · 1 comment
Closed
Labels
bug Something isn't working v2

Comments

@kilobyte2007
Copy link
Contributor

kilobyte2007 commented Dec 20, 2024

Environment

Developement/Production OS: Windows 10 19043.1110
Node version: 16.0.0
Package manager: [email protected]
Radix Vue version: 1.0.0
Vue version: 3.0.0
Nuxt version: 3.0.0
Nuxt mode: universal
Nuxt target: server
CSS framework: [email protected]
Client OS: Windows 10 19043.1110
Browser: Chrome 90.0.4430.212

Link to minimal reproduction

https://stackblitz.com/edit/q8eqei5r?file=src%2FApp.vue

Steps to reproduce

Use the reproduction link and try changing Select value to "Pineapple" twice.
You can see that first time it's numeric, then it's string.

Describe the bug

You can see that when selecting any option that has a numeric value - there's an issue - no label is shown as the emitted value doesn't match any of the values from the option because it is transformed to a string, because SelectRoot emits a string value from the select HTML element and this breaks a lot of scenarios.

Also, for example in our app, we don't need the native select, input[type=checkbox] etc. elements, as they break our integration with vee-validate by emitting redundant events.
@zernonia do you think it makes sense to allow configuring whether a native element is needed at all? Anyway, for now the solution would probably be to just fix this here.

Expected behavior

It should not emit a string value or any value whatsoever.

Context & Screenshots (if applicable)

No response

@kilobyte2007 kilobyte2007 added the bug Something isn't working label Dec 20, 2024
@zernonia zernonia added the v2 label Dec 30, 2024
@zernonia
Copy link
Member

zernonia commented Jan 1, 2025

Fixed in 3971c02

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working v2
Projects
None yet
Development

No branches or pull requests

2 participants