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

useField with RegEx does not parse correctly the params #3073

Closed
LuisMiguelFilipe opened this issue Dec 8, 2020 · 3 comments
Closed

useField with RegEx does not parse correctly the params #3073

LuisMiguelFilipe opened this issue Dec 8, 2020 · 3 comments
Labels
🤔 needs reproduction This issue requires a demo

Comments

@LuisMiguelFilipe
Copy link

Versions

  • vee-validate: 4.0.3
  • vue: 3.0.0

Describe the bug
useField with regex does not parse correctly the params

note: I am assuming that a RegEx can be used with useField

To reproduce
Steps to reproduce the behavior:

  1. define an input field with useField
const ret = useField('my field name', { regex: /^[0-9]+$/ });
  1. type some value in the html input
  2. validation is triggered. argument params value is `{}
  3. Nothing ever fails

What is happening
function buildParams(provided)
is doing Object.keys of a RegEx which returns an empty array [].

I guess a different if statement should be added to handle RegEx

Expected behavior
regex should be evaluated

Demo link
If applicable, add a minimal demo link to help explain your problem. You can use JSFiddle or Codesandbox.

Desktop (please complete the following information):

  • OS:windows
  • Browser [chrome]
  • Version [87]

Smartphone (please complete the following information):
N/A

Additional context
Add any other context about the problem here.

@logaretm
Copy link
Owner

logaretm commented Dec 8, 2020

Can you create an example for this? You can use codesandbox

@logaretm logaretm added the 🤔 needs reproduction This issue requires a demo label Dec 8, 2020
@logaretm
Copy link
Owner

logaretm commented Dec 8, 2020

Never mind, I was able to reproduce it and Identified the issue and fixed it. Should be tagged in the next release shortly

@LuisMiguelFilipe
Copy link
Author

wow! Great work again on fixing it so rapidly 💪

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤔 needs reproduction This issue requires a demo
Projects
None yet
Development

No branches or pull requests

2 participants