selectedOptions bound to observableArray scrolls select list after selection

Visto 73 veces
Saltar al primer mensaje no leído

Valentin

no leída,
18 nov 2010, 7:57:5718/11/10
a KnockoutJS
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
position '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?

Steven Sanderson

no leída,
18 nov 2010, 10:34:5918/11/10
a knock...@googlegroups.com
Thanks for reporting this. We'll need to enhance the selectedOptions binding so that, where possible, it restores the scroll position after each change. 

If you feel able to implement this yourself please go ahead and then send me a pull request. Otherwise, I'll get to it when I have chance.

Regards
Steve

thelinuxlich

no leída,
3 dic 2010, 5:33:483/12/10
a KnockoutJS
Fixed on my branch: https://github.com/thelinuxlich/knockout

On 18 nov, 13:34, Steven Sanderson <ste...@stevensanderson.com> wrote:
> Thanks for reporting this. We'll need to enhance the selectedOptions binding
> so that, where possible, it restores the scroll position after each change.
>
> If you feel able to implement this yourself please go ahead and then send me
> a pull request. Otherwise, I'll get to it when I have chance.
>
> Regards
> Steve
>

Ameet Kaustav

no leída,
27 ago 2015, 14:15:2027/8/15
a KnockoutJS
I am able to see this still occurring on Internet Explorer 11.
On Mozilla Firefox it doesn't scroll to the last selected option.
Here is a fiddle: http://jsfiddle.net/4rdSf/

Ameet
Responder a todos
Responder al autor
Reenviar
0 mensajes nuevos