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

Click event's don't bubble outside SVG #1509

Closed
sdemjanenko opened this issue May 10, 2014 · 5 comments
Closed

Click event's don't bubble outside SVG #1509

sdemjanenko opened this issue May 10, 2014 · 5 comments

Comments

@sdemjanenko
Copy link

Im doing something like:

<button type="button" onClick={this.toggle}>
  {this.props.label}
</button>

If this.props.label is a div, span or some text, clicking on it triggers this.toggle. However, if this.props.label is an svg then onClick never gets triggered.

@syranide
Copy link
Contributor

Do you have a repro? (jsfiddle?)

@sophiebits
Copy link
Collaborator

I can't repro this:

http://jsbin.com/ditulapo/1/edit

@mattweb
Copy link

mattweb commented Oct 29, 2014

I had the same problem. A little CSS solved it for me:

svg {
    pointer-events: none;
}

@uldza
Copy link

uldza commented Nov 26, 2015

@mattweb +1

@AndyOGo
Copy link

AndyOGo commented Dec 9, 2020

Same issue here

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

6 participants