I’m working on a webapp which has a ListSelect with a ValueChangeListener. When selecting a value and holding the down key, the selection scrolls down for a bit, then jumps up, then starts going all over the place. It can be reproduced by the following:
[code]
ListSelect select = new ListSelect();
for(int i = 0; i < 100; i++)
{
select.addItem(i);
}
select.setWidth(200, Unit.PIXELS);
select.setHeight(200, Unit.PIXELS);
select.addValueChangeListener(new Property.ValueChangeListener()
{
@Override
public void valueChange(ValueChangeEvent event)
{
try
{
Thread.sleep(200);
}catch(InterruptedException e)
{
}
}
})
[/code]Note that the Thread.sleep is not necessary if there is latency between the server and client. All that is needed is an empty ValueChangeListener.
So it seems that vaadin is reselecting the value that was sent to the server when the server’s response is received. Is there a way to avoid this behaviour or work around it, so that the selection doesn’t jump around when the user holds the down key?
Thanks,
Anthony