multiple Ember.Select's bound to a single controller, selects do not synchronize at first in Firefox

馋奶兔 提交于 2019-12-25 02:14:07

问题


In this example: http://jsfiddle.net/5WrcD/2/ I have two Ember.Selects with selection bound to a single controller. Using Firefox (I'm running version 15.0 Mac), when I change the value of the first select, the second select does not change. If I then proceed to change the value of the second select to match the first, all subsequent changes to either select will be propagated to the other. Using Chrome/Safari the selects stay synchronized from the beginning.

Could this possible be a bug in Ember or Firefox? Am I wrong to expect the selects to stay synchronized?


回答1:


This is probably not a bug with Ember, but an issue with Firefox I guess.

If you check with a DOM inspector(Firebug) in Firefox you can see that the correct options are getting selected, the two select menus are changing synchronously. Its just that its not being shown in display until we change a couple of times.

So Ember is anyway successful in setting selected="selected" on the correct option , Firefox is having problems showing the correct item in ui.

I created another ticket here for the issue:

HTML select, correct option selected in DOM, but wrong item shown in firefox

Update

After discussions on the other Question, it is found that setting content:'' will fix the issue in firefox. So if you dont want any default selection you are good to go without this.

Eg : http://jsfiddle.net/5WrcD/3/show/

Credits : vol7ron



来源:https://stackoverflow.com/questions/12219587/multiple-ember-selects-bound-to-a-single-controller-selects-do-not-synchronize

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!