Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Without jQuery, ng-mouseleave behaves like mouseout, not mouseleave #1811

Closed
@davemerrill

Description

@davemerrill

The difference between mouseleave and mouseout is that mouseout is triggered by mousing over child elements inside the bound element, while mouseleave is not, in general making it much more useful. Unless jQuery is used, ng-mouseleave acts like mouseout, not mouseleave, which I think is a bug.

There's a full demo here: http://plnkr.co/edit/TEO20k32uLe3r5Nui09F?p=preview

It shows the default behavior, and by un-commenting the included jQuery CDN script tag, you can see how it should behave.

A possible fix is to bind to the native mouseout event, and check whether the mouse is still inside the bound element in code. A demo of that strategy is here: http://plnkr.co/edit/VpdlEygKxrDmPpNyk64M?p=preview

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