ui-select icon indicating copy to clipboard operation
ui-select copied to clipboard

IE8 event delegation in ng-repeat

Open drozv opened this issue 12 years ago • 3 comments

In the following code:

choices.attr('ng-repeat', RepeatParser.getNgRepeatExpression(repeat.lhs, '$select.items', repeat.trackByExp, groupByExp))
              .attr('ng-mouseenter', '$select.setActiveItem('+repeat.lhs+')')
              .attr('ng-click', '$select.select(' + repeat.lhs + ')');

The ng-mouseenter and ng-click events are attached to the initial element that is later converted into a list of elements. The problem is that in IE8 the jquery session attribute is copied from the initial element to each repeated element, and therefore it is the same for each one. As a result, when one of the events is fired for a single element, it is also fired for all of the other elements. This causes IE8 to freeze up and crap out for medium-sized lists (60+ elements).

To fix this, either delegated events or a rewrite of this code needs to be done. I don't really understand why the repeat attribute is used and why the above attributes are attached using jquery...

drozv avatar Jul 23 '14 17:07 drozv

Same as #158?

sambomartin avatar Aug 26 '14 10:08 sambomartin

Please take a look at comment I have left for https://github.com/angular-ui/ui-select/issues/158 . The key is to move some parts from post link function to compile function of directive definition object.

wiciul avatar Nov 13 '14 23:11 wiciul

Closing as resolved by #754 (via #158)

user378230 avatar Mar 20 '16 20:03 user378230