Skip to content

.classes() returns "this.element.className.split is not a function" on svg elements #362

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

Closed
Epro95Z28 opened this issue Jan 19, 2018 · 6 comments

Comments

@Epro95Z28
Copy link

Epro95Z28 commented Jan 19, 2018

Version

1.0.0-beta.2

Reproduction link

https://jsfiddle.net/bnLL85ea/1/

Steps to reproduce

-Perform .classes() on an svg image. Example

What is expected?

A returned array of strings with all the classes

What is actually happening?

this.element.className.split is not a function() error

@LinusBorg
Copy link
Member

  • We are at 1.0.0-beta.11 right now, could you verify if that's still an issue in the latest version?
  • You write about classes() but your code example uses hasClass() - which is it?

@Epro95Z28
Copy link
Author

Epro95Z28 commented Jan 19, 2018

I updated the fiddle. But yes, I am calling .classes
https://jsfiddle.net/bnLL85ea/2/
I looked at -beta.10 and .classes() looks the same as the version I'm running. I will double check though.

@Epro95Z28
Copy link
Author

Updated to 1.0.0-beta.11 and have the same issue still.

@eddyerburgh
Copy link
Member

I can't replicate this using the example you posted. How are you running the tests?

Are you using mocha-webpack? If you're running them in node, are you adding JSDOM properties to the global object?

@Epro95Z28
Copy link
Author

I will try to recreate this issue in a project. I may not be able to do it until next week.

@Epro95Z28
Copy link
Author

Hi everyone,

Was unable to reproduce this issue locally when I had a test project. I think it might have something to do with font-awesome throwing it off. I unfortunately don't have the time to investigate further.

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

3 participants