-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
Changing the base listener
- We found out that there were some events that the window was not listening to. [BUG] It cannot catch and listen for "mouseleave" and "mouseenter" events. #9
- In order for these events to be captured, I had considered adding them to the document instead of the window, using a suitable condition.
- But instead it made much more sense to set the base listener directly as the document.
- Of course, it brought with it the question of how we can listen to the window events.
- It may seem counterintuitive at first glance, but after all, this is a delegation library. People may want to delegate the
divelement for it's childspan. With this requirement, what I will say below has become meaningful. - Structurally, there will still be a selector entry, but we will also require a delegate element, and this will be optional.
events.(element, event, selector, callback)- If element is left blank, it will be document by default.
- People will be able to type something like
events.(window, 'load', '', function (event) {to listen for window events. - They will also be able to properly add non-working events, such as
events.('mouseleave', '.selector', function (event) {, thanks to the document. - In addition to all these, "events.(document.querySelector ('#element'), 'click', '.selector', function (event) {" will be added to the project as an additional feature.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels