angular-click-outside
angular-click-outside copied to clipboard
Click to href doesn't catch click outside
I use click outside to persist one form, but problem is if user is in input field and click on any kind or navigation link in my app which redirects page to other URL the attached function to click outside on that input is never entered.
Hi @vaske,
Without seeing a code snippet I am guess here a little, but it sounds like the reason would be that the location change is happening before the function is being called.
Adding a link to the example in this code base (look inside the /example folder of v2.9.3), sees the menu close before the location change though.
You could get around this by using ng-click rather than href perhaps?.
Happy to look into it further if you can provide a code sample.
it's easy to reproduce just create a navigation with few links which have hrefs in it, and input with click outside on it, when I enter data in input and click on navigation link, click-outside is not entered (no event) and page has been changed.