Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

<a> onClick isn't trigged

See original GitHub issue

No <a> children of SortableElement ever triggers onClick due this:

Reproduceable example:

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10

github_iconTop GitHub Comments

audrey-tlmcommented, Feb 21, 2018

In my case I have added the argument pressDelay={100} to the Sortable List props. So I have :

<SortableList pressDelay={100} items={this.state.items} onSortEnd={this.onSortEnd} />

In that way you can trigger the click on the a AND drag the a less than 1 s after the click.

sureshalagarsamycommented, Oct 1, 2018

Add distance={ 2 } to your <SortableList …> then check

Read more comments on GitHub >

github_iconTop Results From Across the Web

JavaScript button onclick not working - Stack Overflow
Ran into this problem myself so I can confirm something's not right. The difference is that I am generating the DOm Element at...
Read more >
Js : onclick button not triggering - Joomla Stack Exchange
The problem is that your buttons are using the on-click attribute, which isn't valid. You need to use onclick instead. Replace:
Read more >
Onclick not working - JavaScript - SitePoint Forums
whenever I use onclick in javascript (not with onclick attribute in html) it doesn't work. I've never been able to get it to...
Read more >
My onClick functionality is broken? Nothing is getting triggered?
When clicked, an unfocusable <div> with an onClick handler will trigger the handler just as well as a <button> or div[tab-index] would.
Read more >
Bubbling and capturing - The Modern JavaScript Tutorial
On a parent element (meaning an element which is not the target), listeners in the capturing phase will trigger before those for the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found