vue-clickaway
vue-clickaway copied to clipboard
Execute click away function only if strictly necessary
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.