-
Notifications
You must be signed in to change notification settings - Fork 59
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
hasClassWithNative_ throws an error when trying to check for several classes #209
Comments
Hello, @antoniopol06. Can you share the error message? |
It's probably the token native error message alerting that the white space is not allowed. We try to follow the DOM native API but our implementation of |
The hasClass only accepts one class per time, this matches the native behavior of classList contains. |
Hey, @eduardolundgren. This is what @antoniopol06 has reported. In case to follow the same behaviour, the fallback method should also throw an error when it receives more than one class name. |
Got it. Yes they should behave the same (as the native one). |
Correcting what I said before, throws an error seems not be the right approach for this. Once So, it says nothing about throws an error if white spaces are passed. And throws an error seems to be a Chrome implementation only. In this case, we should return false if white spaces are passed. |
Fixed in #231! |
The
hasClass
method throws an error if it is invoked with a list of several classes whenclassList
is available, for example:But, if
classList
is not available it works without errors.The text was updated successfully, but these errors were encountered: