Skip to content

Execute click away function only if strictly necessary #45

@MaurizioRicci

Description

@MaurizioRicci

It would be nice in terms of performance gain if it would be possibile to test when a click is made from inside the target component or not. I mean, now every time a click is made outside target element then the click away function is executed (even if i am click on some other elements).

My suggestion is to check the previous click and the current click and see if the previous click is made inside the target element: If yes, the user is in the target element and with the current click he just clicks away. If no, the user clicked on some other elements and is currently clicking on some other elements (different from the target element) and no click away function should be executed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions