Triggering multiple on-item-click events
I have an array of items that have sub-items, once an item is marked (checked) in the multi-select control a new multi-select controls should render bellow the main (parent) one for each of the marked sub-items.
Everything is almost working out of the box except that the first (parent) multi-select control is triggering multiple on-item-click events and has some kinky UI behavior. I suppose this is related to the DOM been changed by angular repeater that creates the multi-selects for sub-items.
Here is a sample plunker: http://plnkr.co/edit/zacUbpBMsGh203VvwfJb?p=preview
Hi @kovachev ,
Yes I saw that. Unfortunately I'm not sure I have a solution.. at least not now. Been very busy recently.
If you can help with a fix - and I would very much appreciate that :) - the on-item-click is triggered by a $watch. Open the directive code line 838 and you can see it there.
Also, can you help to describe the kinky UI behaviours? I couldn't really see it from your example.
Hi @isteven,
I also don't have a fix for the issue, however I've a simple workaround that fits in my use case. Just added a scope flag to monitor when multi-select is opened and while it is opened the filter function returns the previous marked state, thus preventing DOM changes. Here is the plunker (it might help someone else): http://plnkr.co/edit/sByil7d0rq5dXczUmuSE?p=preview
The kinky UI behavior is related to the issue - just some hover/active styles persist after you mark an item and everything goes back to normal once the pointer leaves the item. This is happening in Chrome, here is a screenshot:

I noticed a similar problem causing a worse outcome, namely one click will cause an item to be selected then unselected (if the item was first unselected and vice versa if the item was selected) making it impossible to select anything other than the initial selection. I noticed this by adding an on-item-click attribute to the element that logged the event to the console. I am using version 2.0.2
I am not sure if this post belongs here, though. I do not have sub-items. If I should open another issue, let me know.
hi @c1moore ,
For the kinky UI behaviour.. I suspect it's related to the dynamic behaviour of the multi-selects (as in the way it is triggered).
Can you please duplicate the problem on Plunker / Fiddler? Thanks.
I have been unable to duplicate the issue so far, oddly. Most of the code is duplicated and I am importing most of the libraries in use. Are there any known issues with snap.js or angular-snap.js? I am still trying to duplicate the problem though.
By the way, I am not noticing the kinky UI behavior, just multiple triggers for on-item-click causing an item to be selected then immediately unselected.
Oddly enough I am not able to duplicate the issue with all of my code duplicated in Plunker and all libraries imported...
The problem appears to be with an extension for Chrome (AngularJS Batarang). Turning it off fixes the problem and turning it back on breaks the multi-selects.
Hi @c1moore ,
A user recently also reported a problem with Angular Batarang: https://github.com/isteven/angular-multi-select/issues/150
I'm really confused.. Can any Batarang users explain why?
@isteven it's not only this directive problem. It was working fine with Batarang before Batarang's update. Take a look here: https://chrome.google.com/webstore/detail/angularjs-batarang/ighdmehidhipcmcojjgiloacoafjmpfk/reviews
I have decided just not to use Batarang for now. It wasn't awfully useful to me anyways after the changes everybody seems to be complaining about in the link @ktopolski gave.