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

IE8 - 10: Rendering doesn't seem to work properly with select directive #4749

Closed
@wesleycho

Description

@wesleycho

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 in ng-repeat, and the particular instance object from ng-repeat (i.e. ng-repeat="item in items", so ng-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:

`$timeout(function () {
  $('.lte9 select').each(function (idx, elem) {
    $(elem).find('option').each(function (idx2, option) {
      $(option.text($(option).text() + ' ');
    });
  });
  $(elem).hide().show();
});

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions