Dropdown auto-close outsideClick issue when menu items change
Hello,
I'm working on creating a dropdown menu that uses an input box to search through that menu. I'm trying to make it so that as the user clicks on options in the menu, they are removed from that menu. I need to make the menu stay open during this process (i.e. be able to remove multiple items from the menu without it closing). Using auto-click="outsideClick" does not work when items are removed from the menu using splice().
I created a minimal reproduce scenario plunkr here: http://plnkr.co/edit/OCNhSxesFd9H0hbN76WH?p=preview
This seems to be a bug; though, perhaps there is another preferred way of doing this.
Thanks, Andrew
You should pass $event to your callback in your ng-click and call $event.stopPropagation() in the callback.
Here is an example with this in action.
Awesome. Thanks for your help!
you solved my problem, thanks a lot, but why? 难死宝宝了!