Skip to content

mouseEnter/Leave event delegation broken w/o jQuery #16591

@simonihmig

Description

@simonihmig

For components that have a mouseEnter() (and/or mouseLeave()) event handler, these are not called anymore when running without jQuery.

I think this is because those events don't bubble, so event delegation based on the root element, which is what the EventDispatcher is doing, does not work. Those events get only triggered for the element having the listener (the app's rootElement in this case). See https://developer.mozilla.org/en-US/docs/Web/Events/mouseenter

A possible workaround would be to use mouseover under the hood, to enable event delegation, and to make sure it behaves the same as the mouseEnter (i.e. doesn't trigger again for child elements). jQuery seems to do the same, that's why it works in jQuery mode: https://github.com/jquery/jquery/blob/899c56f6ada26821e8af12d9f35fa039100e838e/src/event.js#L666-L700

I could work on a PR, if we agree this ^ is the way forward!?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions