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

classList.add() is not working with similar strings #43

Open
jozsefs opened this issue Jul 2, 2015 · 1 comment
Open

classList.add() is not working with similar strings #43

jozsefs opened this issue Jul 2, 2015 · 1 comment

Comments

@jozsefs
Copy link

jozsefs commented Jul 2, 2015

If the element has e.g: 'btn-active' class you can't add 'btn' because the indexOf already returns that it found the string 'btn' as part of 'btn-active'.

bobbykjack added a commit to fiveminuteargument/polyfills that referenced this issue Nov 9, 2016
Contains() should use pre-computed internal list of individual classes, rather than element's className, to avoid greedy false-positives.
@robsonsobral
Copy link

@remy , may I submit a pull request to fix 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

2 participants