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: Query Selector returns empty array #686

Closed
Teddy-Schmitz opened this issue Aug 1, 2017 · 3 comments
Closed

Bug: Query Selector returns empty array #686

Teddy-Schmitz opened this issue Aug 1, 2017 · 3 comments
Labels
🐛 bug Unintended behavior

Comments

@Teddy-Schmitz
Copy link

Versions:

  • VueJs: 2.3.4
  • Vee-Validate: 2.0.0-rc.8

Description:

Query selector doesn't work on iOS Safari.

For check boxes there is an if statement that attempts to select the element starting at line

https://github.com/baianat/vee-validate/blob/691edebf89ab512dd1324d1fcd12267e874af818/dist/vee-validate.js#L2354

This query selector always returns empty in iOS 9 on an iPhone 6s Plus. It works fine in Android Chrome as well as desktop Chrome. This causes a few errors to pop up in the console namely.

TypeError: document.querySelectorAll(...).forEach is not a function

so none of the event listenters get attached and when a user clicks on the checkbox this errors pops.

[vee-validate] Validating a non-existant field: "#_i945qg17t". Use "attach()" first.

Steps To Reproduce:

Create a checkbox input with an attached validator such as "required". Open on iOS.

@Teddy-Schmitz
Copy link
Author

O I can't say i know enough about iOS Safari to know what the cause is, the selector looks ok to me.

@logaretm logaretm added the 🐛 bug Unintended behavior label Aug 1, 2017
@logaretm
Copy link
Owner

logaretm commented Aug 1, 2017

You are right, this is bug. I should convert the NodelList to a proper array first. because not all browsers extend the NodeList with the array methods.

Thanks for reporting this.

@logaretm
Copy link
Owner

logaretm commented Aug 1, 2017

Fixed in 61ac187

@logaretm logaretm closed this as completed Aug 1, 2017
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

2 participants