Skip to content

onClick handler not fired on children #20

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

Open
scott-coates opened this issue Jan 14, 2016 · 7 comments
Open

onClick handler not fired on children #20

scott-coates opened this issue Jan 14, 2016 · 7 comments

Comments

@scott-coates
Copy link

<Link to='/home' onClick={this.onItemClick}>
  <i className="fa fa-file"></i>   
  <span id='works'>Click me - I work!!</span>
  <Highlighter search={this.props.query} caseSensitive={false}>
    {this.props.name}
  </Highlighter>
</Link>

this.onItemClick is only invoked when clicking on span#works. However, clicking any of the elements from Highlighter doesn't actually propagate the event in any way. I've found that it does work when I remove {'key': this.count} from the children in the array.

@rafaelcorreiapoli
Copy link

I'm also facing this issue.

@lnmunhoz
Copy link

lnmunhoz commented Nov 7, 2016

+1

1 similar comment
@franciscopuyo
Copy link

+1

@hartuvofir
Copy link

hartuvofir commented Aug 17, 2017

line 177 : React.DOM.span({'key': string}, string);
line 191 : key: string,

The problem was that each element get the same key (count).
with string its unique

@lnmunhoz
Copy link

lnmunhoz commented Aug 17, 2017

I stopped using this package and started using react-hightlight-words. It fixed this issue.

@janmyler
Copy link
Contributor

There's a PR open #46 to fix it, however, it usually takes a rather long time to get anything merged.

@ericgio
Copy link
Contributor

ericgio commented Oct 29, 2017

As a workaround, you can set pointer-events: none on the highlighter component.

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

7 participants