多个Ember.Select绑定到单个控制器,选择在Firefox中不首先同步 [英] multiple Ember.Select's bound to a single controller, selects do not synchronize at first in Firefox
问题描述
在这个例子中: http://jsfiddle.net/5WrcD/2/ 我有两个 Ember.Select
与选择
绑定到单个控制器。使用Firefox(我正在运行版本15.0 Mac),当我改变第一个的值时,选择
,第二个选择
不会改变。如果我继续改变第二个的值,选择
以匹配第一个,那么对选择
的所有后续更改将会被传播到另一个。使用Chrome / Safari,选择
从头开始保持同步。
select s保持同步吗?解决方案这可能不是一个Ember的错误,但与Firefox的问题我猜。
如果您在Firefox中检查与DOM检查器(Firebug),您可以看到正确选项正在被选中,两个选择菜单正在同步更改。它只是它没有被显示,直到我们改变了几次显示。
所以 Ember
无论如何成功在正确的选项
中设置 selected =selected
时,Firefox在使用ui时显示正确的项目时出现问题。 / p>
我为此问题创建了另一张票:
HTML选择,在DOM中选择正确的选项,但在Firefox中显示错误的项目
更新
在讨论另一个问题后,发现设置内容:
将解决在Firefox的问题。所以,如果你不想要任何默认的选择,你是不好的,没有这个。
例如: http://jsfiddle.net/5WrcD/3/show/
学分: vol7ron
In this example: http://jsfiddle.net/5WrcD/2/ I have two Ember.Select
s 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 select
s stay synchronized from the beginning.
Could this possible be a bug in Ember or Firefox? Am I wrong to expect the select
s to stay synchronized?
解决方案 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
这篇关于多个Ember.Select绑定到单个控制器,选择在Firefox中不首先同步的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!