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

Polyfill does not replace classList.toggle in IE11 #14

Closed
schreifels opened this issue Aug 31, 2016 · 4 comments
Closed

Polyfill does not replace classList.toggle in IE11 #14

schreifels opened this issue Aug 31, 2016 · 4 comments
Assignees

Comments

@schreifels
Copy link

schreifels commented Aug 31, 2016

Unexpected behavior

In IE11, classList.toggle does not take a second parameter, and the polyfill does not correct this. As an example, I created http://jsfiddle.net/4w949/64 , which contains the source code from yola/classlist-polyfill, along with a console.log(document.body.classList.toggle); below it.

In this case, [ native code ] is shown in the developer console in IE11.

Expected behavior

For comparison, I took the latest polyfill on MDN in the same fashion: http://jsfiddle.net/4w949/65 . Here, the console.log does not return [ native code ]; it (correctly) returns the implementation from the polyfill, which supports the second parameter.

@schreifels schreifels changed the title Polyfill does not replace classList in IE11 Polyfill does not replace classList.toggle in IE11 Aug 31, 2016
@schreifels
Copy link
Author

Indeed, this is apparently a long-standing issue, see eligrey/classList.js#44

Perhaps we could change the upstream of this module to be https://github.com/stevenvachon/classList.js , which contains a fix?

@snitch
Copy link

snitch commented Sep 5, 2016

@beck: This issue is now a priority.

@stevenvachon
Copy link

stevenvachon commented Sep 7, 2016

I didn't know about this library. If you merge my fork with this one, I can remove mine -- I'd prefer not to keep it anyway.

@beck
Copy link
Contributor

beck commented Sep 12, 2016

This is a duplicate of: eligrey/classList.js#54

I've started a new repo that is a proper github branch of the source. I've opened a pull upstream:
eligrey/classList.js#57

If merged, I'll merge down into our branch and cut a new release from https://github.com/yola/classlist-polyfill

@beck beck closed this as completed Sep 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants