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

node.className.split is not a function on tracking click on/near SVG element #8346

Closed
dandv opened this issue Jul 14, 2015 · 1 comment
Closed
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@dandv
Copy link
Contributor

dandv commented Jul 14, 2015

I've created a mirror of our signup page where we experience this error. Steps to reproduce:

  1. Go to https://idorecall.com/static/bug-demos/piwi-classname.split/
  2. Enter some email
  3. In the signup success page, click on the "F"acebook link/icon.

After a few seconds, the Chrome console displays

piwi.js:1390 Uncaught TypeError: node.className.split is not a function

The piwik.js is from July 1st and the line in question is var classes = node.className.split(' ');

The error occurs despite the checks for presence of className because the element in question is an SVG <use> and node.className is SVGAnimatedString {}. My markup is

<a target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=https%3A//iDoRecall.com/?signupref">
  <svg>
    <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#fa-facebook"></use>
  </svg>
</a>

http://stackoverflow.com/questions/12588913/svganimatedstring-missing-method-indexof suggests a possible solution.

A workaround is to add bogus classes to <svg> and <use> elements in the markup.

@mattab
Copy link
Member

mattab commented Jul 14, 2015

Thanks for the report, the pull request is #8347

@mattab mattab added the Bug For errors / faults / flaws / inconsistencies etc. label Jul 14, 2015
@tsteur tsteur closed this as completed in ced23ba Jul 20, 2015
tsteur added a commit that referenced this issue Jul 20, 2015
Handle clicks on SVG elements. Fix #8346.
@mattab mattab modified the milestone: 2.15.0 Sep 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

No branches or pull requests

2 participants