Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

ngOptions can cause flickering/jumping highlight on Firefox #6769

Closed
bvaughn opened this issue Mar 20, 2014 · 8 comments
Closed

ngOptions can cause flickering/jumping highlight on Firefox #6769

bvaughn opened this issue Mar 20, 2014 · 8 comments

Comments

@bvaughn
Copy link

bvaughn commented Mar 20, 2014

Request Type: bug

How to reproduce: http://plnkr.co/edit/ciOEcE9fidbeXzRrZ2HN?p=preview

Component(s): ngOptions

Impact: medium

Complexity: small

Detailed Description:
The ngOptions directive causes a strange flickering behavior on Firefox when the digest loop is triggered. This issue does not occur for Safari or Chrome. I encountered this issue in version 1.2.14 but after researching, I believe it's been around since version 1.0.x.

Other Comments:
I was able to "fix" this issue by editing src/ng/directive/select.js line 534 as follows:

-                if (lastElement[0].selected !== option.selected) {
+                if (existingOption.selected !== option.selected) {

Unfortunately this breaks on of the select unit tests, should select correct input if previously selected option was "?".

I'll play with it some more but would welcome any input from the community.

@Narretz
Copy link
Contributor

Narretz commented Mar 20, 2014

Can you check with the latest master? It sounds like this was fixed with f40f54c

@bvaughn
Copy link
Author

bvaughn commented Mar 20, 2014

@Narretz That surely does look like a fix! Any chance at all of this fix making its way into the 1.2.x branch?

Unfortunately my team is stuck on 1.2.x for the foreseeable future due to 1.3.x's lack of official IE8 support so a fix in master doesn't help us all that much.

@bvaughn
Copy link
Author

bvaughn commented Mar 20, 2014

@Narretz I just applied that fix to my local checkout of v1.2.x. Tested in Firefox and also ran grunt test. Fix seemed to work for both!

@Narretz
Copy link
Contributor

Narretz commented Mar 20, 2014

Someone from the team should confirm this, but I think that all non-breaking fixes will go into 1.2.x

@caitp
Copy link
Contributor

caitp commented Mar 20, 2014

@Narretz this has been confirmed, it's a duplicate of another issue, let me dig up the version number. There is already a PR to fix this, and it may have even already landed

edit Yeah, this is already fixed, if you change 1.2.14 to snapshot in the script url for angular, you'll see you can't reproduce this on the master branch. I can see if we want to cherrypick that fix. This was fixed by #5994 / f40f54c

@caitp
Copy link
Contributor

caitp commented Mar 20, 2014

I just asked if this should be backported, and it sounds like a yes, so I'll see if it passes on jenkins and merge it, I guess

caitp pushed a commit that referenced this issue Mar 20, 2014
In Firefox, hovering over an option in an open select menu updates the selected property of option
elements. This means that when a render is triggered by the digest cycle, and the list of options
is being rendered, the selected properties are reset to the values from the model and the option
hovered over changes. This fix changes the code to only use DOM elements' selected properties in a
comparison when a change event has been fired. Otherwise, the internal new and existing option
arrays are used.

Closes #2448
Closes #5994
Closes #6769
@caitp caitp closed this as completed Mar 20, 2014
@caitp
Copy link
Contributor

caitp commented Mar 20, 2014

Closed by f40f54c and dc149de

@bvaughn
Copy link
Author

bvaughn commented Mar 21, 2014

Thanks much, Caitlin.

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

3 participants