vaadin / framework

Vaadin 6, 7, 8 is a Java framework for modern Java web applications.
http://vaadin.com/
Other
1.78k stars 730 forks source link

Combobox scrolling does not work #12609

Closed Tymur-Lohvynenko-Epicor closed 5 months ago

Tymur-Lohvynenko-Epicor commented 5 months ago

Combobox popup scrolling does not work if setScrollToSelectedItem(true), it's just stuck on one page.

Vaadin Framework version - 8.24.0

You can reproduce bug with the following code:

ComboBox<String> comboBox = new ComboBox<>();
comboBox.setScrollToSelectedItem(true);

List<String> items = IntStream.range(1, 50)
        .mapToObj(n -> "Item #" + n)
        .collect(Collectors.toList());

comboBox.setItems(items);
comboBox.setValue(items.get(items.size() / 2));

Also you can use repo-vaadin8-combobox-scrolling-bug to reproduce this.

TatuLund commented 5 months ago

I tested this in my Vaadin 8.24 project with the code you have in this ticket, and I can't reproduce it. When I open ComboBox drop down, it scrolls to Item #25 correctly.

I would like you to verify that when you have upgraded to Vaadin 8.24 you have recompiled the widgetset if you are having local widgetset. Misaligned widgetset is a common source for random glitches.

TatuLund commented 5 months ago

Furthermore we have very similar case included in our set of automated regression tests, this should prevent us releasing a version where this functionality would be trivially broken:

https://github.com/vaadin/framework/blob/master/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxScrollToSelectedItem.java

Tymur-Lohvynenko-Epicor commented 5 months ago

Sorry for not clear description. The problem is that when I open ComboBox drop down, I get a page with items from 20 to 29, but I can not scroll to the other items, it's just stuck on this page. I can not choose items from 1 to 19 and from 30 to 49.

Tymur-Lohvynenko-Epicor commented 5 months ago

After testing with different versions I've found that this bug appeared in 8.18.0

TatuLund commented 5 months ago

Thanks for that detail, then it is clearly regression after this fix https://github.com/vaadin/framework/issues/12562

TatuLund commented 5 months ago

Actually it is this PR that broke it in 8.18.1 https://github.com/vaadin/framework-es/pull/78

rkovarik commented 5 months ago

Hey 👋

Disabling paging might serve as a potential workaround. However, this could lead to encountering the security limit for the number of items, which was introduced by https://github.com/vaadin/framework/pull/12415. This could be avoided by increasing the limit https://github.com/vaadin/framework/pull/12466 but since we don’t know the actual size of the data, we would be forced to artificially increase the limit, potentially causing the security issue to reoccur.

We haven’t yet implemented the affected version in production, but this issue could hinder us from doing so. Is there a better workaround for this issue?

thevaadinman commented 5 months ago

The fix for this issue is due to be released with Vaadin 8.25.1.

thevaadinman commented 5 months ago

8.25.1 has been released.