Skip to content
This repository has been archived by the owner on Oct 2, 2019. It is now read-only.

IE8 event delegation in ng-repeat #120

Closed
drozv opened this issue Jul 23, 2014 · 3 comments
Closed

IE8 event delegation in ng-repeat #120

drozv opened this issue Jul 23, 2014 · 3 comments

Comments

@drozv
Copy link

drozv commented Jul 23, 2014

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...

@sambomartin
Copy link

Same as #158?

@wiciul
Copy link

wiciul commented Nov 13, 2014

Please take a look at comment I have left for #158 . The key is to move some parts from post link function to compile function of directive definition object.

jlfama pushed a commit to jlfama/ui-select that referenced this issue Nov 19, 2014
@user378230
Copy link
Contributor

Closing as resolved by #754 (via #158)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants