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

add() function with no arguments #72

Open
ShiningDan opened this issue Sep 16, 2017 · 3 comments
Open

add() function with no arguments #72

ShiningDan opened this issue Sep 16, 2017 · 3 comments

Comments

@ShiningDan
Copy link

Hello, I am a little confused when using the add function in classList.js. If I pass no argument to add, just like:
element.classList.add(), the element class will add "undefined" to the end.

This is because the source code using token = tokens[i] + ""; to generate className "undefined" , but in HTML5 classList property, element.classList.add() will not affect the class name.

Of course this is an easy bug to fix, I am wondering if it is some kind of features so you leave it the way? Or it is just a bug :)

Sorry for my poor English and looking forward to your reply.

@eligrey
Copy link
Owner

eligrey commented Dec 10, 2017

This is a valid bug and I will look into it at a later time

@dolgachio
Copy link

@eligrey I can fix that if you don't mind

@dominique-mueller
Copy link

We're experiencing the same issue, I'm also happy to take a look at it.

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

No branches or pull requests

4 participants