Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Execute click away function only if strictly necessary #45

Open
MaurizioRicci opened this issue Dec 30, 2019 · 0 comments
Open

Execute click away function only if strictly necessary #45

MaurizioRicci opened this issue Dec 30, 2019 · 0 comments

Comments

@MaurizioRicci
Copy link

MaurizioRicci commented Dec 30, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant