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

fix(select): ensure the label attribute is updated in Internet Explorer #10042

Closed

Conversation

petebacondarwin
Copy link
Contributor

Fixes #9621

@@ -1300,6 +1320,25 @@ describe('select', function() {
expect(scope.selected).toBe(scope.values[0]);
});

// bug fix #9621
if (msie) {
it('should update the label attribute if running in MS IE', function() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this test not work outside of IE? or is the behaviour different in IE? I feel like we should probably run the test for both IE and not

@caitp
Copy link
Contributor

caitp commented Nov 13, 2014

I am trying to reproduce the issue that this fixes on IE10 on SL, but I'm not able to (using basically a reproduction of the unit test case). Is the unit test testing the actual issue?

@petebacondarwin
Copy link
Contributor Author

@caitp - You are right. The unit test does not actually test the issue. It tests the fix. I will try to make a more realistic test.

@petebacondarwin
Copy link
Contributor Author

Unfortunately, as this is a rendering issue, I cannot reproduce in a unit test. The programmatic interface is accurate, but it just hasn't triggered the correct re-rendering of the currently selected label.

@petebacondarwin
Copy link
Contributor Author

OK, so we don't need to update the label attribute, updating the label property is enough.

@petebacondarwin
Copy link
Contributor Author

That means that we don't need the first commit, the second becomes simpler, we can apply the fix to all browsers and the test can be applied to all browsers too. It is also simple enough that it should be able to go into 1.2.x

…tion` matcher

By using a new matcher our tests become less brittle with respect to unimportant
extra attributes.
Only changing the `<option>` text value is not enough to trigger a render
change in IE. We need to explicit update the `label` property too.

Closes angular#9621
@petebacondarwin
Copy link
Contributor Author

@caitp - it is not possible to actually test for the bug (without taking a snapshot of the screen and comparing images) since it is not exposed by the programmatic interface. The test checks that the fix is in place. I changed the code to update the label for all browsers and removed all browser specific conditions from both the source and the tests. Can you review, please?

@caitp
Copy link
Contributor

caitp commented Nov 14, 2014

hmm, and I guess reftesting it isn't really possible either... alright, lgtm

@petebacondarwin
Copy link
Contributor Author

I don't know what a reftest is. Is it this: http://adobe.github.io/web-platform/presentations/testtwf-how-to-write-a-reftest/

@caitp
Copy link
Contributor

caitp commented Nov 14, 2014

yeah basically --- it's a testing strategy used in (some) browsers, but there are some tools that offer this as well.

petebacondarwin added a commit that referenced this pull request Nov 15, 2014
Only changing the `<option>` text value is not enough to trigger a render
change in IE. We need to explicit update the `label` property too.

Closes #9621
Closes #10042
@petebacondarwin petebacondarwin deleted the select-label-fix branch November 24, 2016 09:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IE (8-10) rendering issue when dynamically changing options
2 participants