question-mark
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.

Move page click handler to parent element so click target is larger

See original GitHub issue

I’m proposing that the click handler be moved from the a element up to the li element. The current click target in most cases will be a single numeral. I needed to support a larger click target for my use case so I moved the click handler up to the parent element.

PR: https://github.com/AdeleD/react-paginate/pull/82

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
AdeleDcommented, Jun 20, 2016

Ok, thank you for the explanation. Let’s merge.

0reactions
dnewcomecommented, Jun 20, 2016

np thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can you target an elements parent element using event.target?
I think what you need is to use the event.currentTarget . This will contain the element that actually has the event listener. So...
Read more >
Enhancing The Clickable Area Size - Ahmad Shadeed
In simple words, the larger and closer the touch or click target is, the less time it will require the user to interact...
Read more >
Be Slightly Careful with Sub Elements of Clickable Things
Event delegation is where you bind the click handler not directly to the element itself, but to an element higher up the DOM...
Read more >
Bubbling and capturing - The Modern JavaScript Tutorial
The bubbling principle is simple. When an event happens on an element, it first runs the handlers on it, then on its parent,...
Read more >
Understanding JavaScript Event Delegation Technique By ...
In this tutorial, you will learn how to use the JavaScript event delegation that adds a single event handler to the parent element...
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 Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found