-
Notifications
You must be signed in to change notification settings - Fork 27.4k
IE8 - 10: Rendering doesn't seem to work properly with select directive #4749
Comments
Just a further update on this if anyone is stuck here, I updated this hack in order to get correct behavior in IE9 & IE10 with this:
|
@wesleycho if this is just a rendering issue then you should pass |
a fix that could make it into angular could most likely not use $timeout, is there another way around this? |
I could take a look at it, this hack was created under extreme time pressure - the problem is purely a rendering issue though due to IE8 - 10 (not sure about 11) not correctly rendering updated options in the select element. |
So I did some investigation, and it would appear that the fix should appear inside the render function of the select directive. However, the two "fixes" I came up with both cause IE to execute a blur as soon as you click the select element, but otherwise work as they're supposed to in forcing the browser re-render. I might have been looking in the wrong place to try to implement a fix, but I suspect that The issue here is that cloning a DOM template (in this case, the usage of From what I understand, this is a problem present in all IE browsers, including IE11. |
+1 |
+1 Any fixes for this yet? |
Can the priority on this be increased? It happens with what seems to me to be a very common use case. If your model doesn't have any kind of initial value, the select gets messed up the first time you select an option. See the following fiddles: http://jsfiddle.net/eFP4g/ (1.2.20) It happens in IE9, IE10, and IE11 It looks like this specific issue was fixed with 1.2.21 (http://jsfiddle.net/sLC9b/). I'm guessing this is the same as issue #7692 |
this is being worked on @dnchristiansen |
If it helps, I posted a SO on this when we first ran into this. There a few different workarounds people came up with. |
Adding couple of lines the following places (marked in bold as ** ) in render function of the selectDirective in angular.js worked fine for me. I am looking if there is any other possible solution other than patching angularJS or the forEach given below?
and
The issue was the label attribute of HTMLOptionElement is not the same as the text attribute if label is blank in IE. This can be seen verified by adding the following code after the screen has loaded and looking at the web console of FF and IE to see the difference. If you uncomment the last line where the label is set to text it works fine. Alternatively patch angular.js as above.
|
That is not a good patch for Angular, as Angular should not be requiring jQuery in order to fix this issue, or be running a very unperformant block of code like such, due to essentially calling From what I understand from @rodyhaddad, this has been fixed on |
Adding the two lines of code from @asranjan above fixes the issue for me. Any reason those changes couldn't be made in the angular code? |
this has been fixed already and works as expected in IE10 with 1.3.0-rc.2: http://jsfiddle.net/9kmk1wsv/1/ if there are still some remaining issues, please create a jsfiddle/plunker and a new issue. thanks! |
I am not able to reproduce this currently unfortunately, but I am seeing some strange behavior here for these browsers in particular with 1.2.0-rc.2. For Chrome & Firefox, this works just fine.
We have select elements nested in an ng-repeat, and each repeated element has two selects, one to set a parent object to one model, and the other to set a child object of the parent to another model. The select element with the children objects are filtered in
ng-options
according to the repeater array inng-repeat
, and the particular instance object fromng-repeat
(i.e.ng-repeat="item in items"
, song-options=".... foo in array | filter: filterFoos(items, item)
). The filter modifies the items you can select from in the second select element according to what has already been selected for that particular parent object, say subtopics of a parent topic & not being allowed to select a duplicate of what has already been selected.In IE8 - 10, I can select the same parent topic in two different repeated select elements. I can then select different children options for the first time in each of the other repeated select elements, and the filter displays the correct set. However, once you change one of those selected options for the select that selects from children objects, IE8 - 10 lose track, and fail to render them correctly.
I have a
scope.$watch
in the controller that is dealing with this template, and currently I employ this hack to make the problem a benign one in IE8:However, this does not solve the problem of the same value showing in IE9 and IE10 when the loss of correct rendering happens - Angular is still keeping track of the model correctly, and Angular renders the DOM correctly here. This is an IE display problem with dynamic options that isn't quite solved correctly in Angular.
It should be noted, that hack could easily be implemented in a directive without jQuery for those interested readers.
The text was updated successfully, but these errors were encountered: