Firefox select dropdown keeps refreshing/reverting to default option due to running Javascript - AngularJS

后端 未结 4 1564
醉梦人生
醉梦人生 2021-02-12 22:52

I\'m building an app in AngularJS and am having trouble with select dropdown menus when using Firefox.

When I click a select menu and hover over the options, it resets

4条回答
  •  [愿得一人]
    2021-02-12 23:47

    Some people will still face this problem.

    Here is the fix:

     if (existingOption.id !== option.id) {
        lastElement.val(existingOption.id = option.id);
     }
    -if (existingOption.element.selected !== option.selected) {
    +if (existingOption.selected !== option.selected) {
          lastElement.prop('selected', (existingOption.selected = option.selected));
     }
    } else {
    

    Add this patch directly into the angular core. This bug still persists in v1.2.8

提交回复
热议问题