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

Error when className is not of type string #114

Closed
SebastianWachsmuth opened this issue Mar 17, 2022 · 3 comments
Closed

Error when className is not of type string #114

SebastianWachsmuth opened this issue Mar 17, 2022 · 3 comments

Comments

@SebastianWachsmuth
Copy link

SebastianWachsmuth commented Mar 17, 2022

For some DOM-Elements className is not of type string (svg for example)

In those cases .split() will throw. same error as #110

could maybe be fixed by using element.classList. it has a contains method

@SebastianWachsmuth SebastianWachsmuth changed the title i just found out, that it will also throw, if the first element is an svg, since class will be of type [SVGAnimatedString](https://developer.mozilla.org/en-US/docs/Web/API/SVGAnimatedString) which doesnt have a split method Error when className is not of type string Mar 17, 2022
@stavroskasidis
Copy link
Owner

Ok thank you for reporting this. I will work on it and provide a patch.

@SebastianWachsmuth
Copy link
Author

the simplest way, with the fewest changes is to replace line 41 and 63 with
var classes = el.classList != undefined ? el.classList : [];

stavroskasidis added a commit that referenced this issue Mar 17, 2022
@stavroskasidis
Copy link
Owner

Changed in 1.13

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