Skip to content

Non-bubbling events won't trigger, but are accepted. #7

@HLSiira

Description

@HLSiira

Test case: https://codepen.io/hlsiira/pen/mdeyvVN

Hey, I think I have come across a weird edge case that I can't quite nail down the issue.

When using Events, some event types don't bubble to the window, like MouseLeave, or MouseEnter, which means they are never triggered using Events. In trying to fix the issue, I tried to write a function to test whether or not an event type would bubble or not, and if it doesn't, add the listener directly to the element instead of to the window.

However, in trying to fix the issue, I noticed that MouseLeave seems to bubble in Firefox, but not in Chrome; more like in Firefox, MouseLeave acts like MouseOut.

Originally I figured it was just a simple case of detecting if the event type bubbles or not, but due to the weird Firefox VS Chrome handling, I'm not really sure if that is the actual issue, or if it's something else.

Thanks for making an awesome helper library, it's made coding way easier!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions