Type of `delegate(Element, string, EventType, Handler)` doesn't seem to work
See original GitHub issueThese work in TypeScript:
delegate(".base", ".clickable", "click", handler);
delegate(select.all(".base"), ".clickable", "click", handler);
This doesn't
But the Single base element specified
overload doesn’t:
delegate(select(".base"), ".clickable", "click", handler);
TS2345: Argument of type 'HTMLElement | null' is not assignable to parameter of type 'string | ArrayLike<Element>'.
Type 'null' is not assignable to type 'string | ArrayLike<Element>'.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Event handler not working on dynamic content - Stack Overflow
So when I click on tag B, action B is performed. However, the .on method does not seems to be working on the...
Read more >Event listeners not working? 3 key areas to troubleshoot
Are your event listeners not working as you'd expect? Here are 3 key areas to troubleshoot to help you get everything triggering as...
Read more >Event delegation - The Modern JavaScript Tutorial
The document-level handler makes it work for any element of the page. We can combine multiple behaviors on a single element as well....
Read more >EventHandler Delegate (System) - Microsoft Learn
The EventHandler delegate is a predefined delegate that specifically represents an event handler method for an event that does not generate data. If...
Read more >wilsonpage/dom-delegate: Create and manage a ... - GitHub
Delegate is a simple, easy-to-use component for binding to events on all target elements matching the given selector, irrespective of whether they exist...
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
Indeed it was! Sorry about the noise 😅
I think… that’s because select returns
HTMLElement | null
I’ll try again withselect()!