开发者

KnockoutJS selectedOptions binding causes select box to jitter in IE8

This is only in IE8, Occurs when I have a multiple values select box bound to observableArray with selectedOptions and there are more items than select can show (scrolling is enabled). So whenever I Ctrl+click the item in a select box the scrolling positi开发者_StackOverflow社区on 'jumps away' and I end up being scrolled down a bit. This produces a jittery unpleasant experience. As I understand it, this problems is because of two-way binding of selectedOptions: when I click on an item, it gets added to the array, which in turn causes the select box refill after observableArray notifies the UI of its changes. Is there anything that can be done?

UPDATE:

I ended up using this binding:

<select data-bind='visible:operator() ? operator().Element == "DropDown" : false, 
                                options: property() ? property().ReferenceItems : null, 
                                optionsText: "Name", 
                                optionsValue: "Id", 
                                optionsCaption: "Выберите...", 
                                selectedOptions: selectedValues,
                                multiple: selectedValues().length > 1'>
</select>


I don't know... all I can recommend is try asking this on the knockoutjs google group. It seems to be active and has folks who are experts responding to stuff like this.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜