Move page click handler to parent element so click target is larger
See original GitHub issueI’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.
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (5 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok, thank you for the explanation. Let’s merge.
np thanks!