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

[v4] Preserve value binding type for select element #3440

Closed
5 tasks done
logaretm opened this issue Aug 12, 2021 · 0 comments
Closed
5 tasks done

[v4] Preserve value binding type for select element #3440

logaretm opened this issue Aug 12, 2021 · 0 comments
Assignees
Labels
🐛 bug Unintended behavior

Comments

@logaretm
Copy link
Owner

What happened?

When binding a <select> element's options to values using :value="something", when the option gets selected the value is cast to a string.

This is because vee-validate uses the e.target.value in that case, it should resolve the actual value in the same way it does for checkboxes.

Reproduction steps

  1. Create a select element using either useField or Field component
  2. Add options with value bindings to types other than string
  3. Select the option and notice the value is cast to a string and not using the bound value

Version

Vue.js 3.x and vee-validate 4.x

What browsers are you seeing the problem on?

  • Firefox
  • Chrome
  • Safari
  • Microsoft Edge

Relevant log output

No response

Demo link

https://codesandbox.io/s/objective-minsky-ulqdh?file=/src/App.vue

Code of Conduct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Unintended behavior
Projects
None yet
Development

No branches or pull requests

1 participant