You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sudden jump to first combo box item
My combo box uses a data provider that provides >400 items. When opening the combo box by arrow down key the focus lays on the first item. Further arrow down key hits go to 2nd, 3rd,... item. Reproduceable (after page refresh) on the 29th entry, the next arrow down does not focus the 30th item, but the focus is lost. Next arrow down focusses the 1st item (and item list is scrolled to top).
When I go on, arrow down key strokes bring me to item no. 79, on next stroke the focus got lost, next jumps back to item no. 1.
In the third loop I can reach item 129.
And so on. With every loop I can go deeper (each time plus 50 item - which is the page size)
Depends on browser zoom factor
When zooming in, the sudden jump is done later. For instance, with zoom factor 160% I can reach items 37, 87, 137 etc. before jumping to item 1; with zoom factor 300%: items 46, 96, 146.
When zooming out - now the maximum height of the combo box item list is less then the docuement height -, the sudden jump is made when reaching the visible end of the items list.
Depends on data provider
There is no such a strange behaviour, if items are provided "hard-coded" by items property of the combo box instead of using a data provider.
Description
In combo-box scroller, there is a logic to adjust scroll position so that focused item always remains in the viewport:
web-components/packages/combo-box/src/vaadin-combo-box-scroller.js
Lines 208 to 211 in 5ddcd58
For some reason (maybe due to refactorings done for Vaadin 22 and later) this does not always work:
viewport.mp4
Note: this happens much often when item heights are different (in this case, some countries are too long and wrap in 2 lines).
Expected outcome
Focused item should always get scrolled into view when pressing Arrow Down
Minimal reproducible example
Steps to reproduce
Environment
Vaadin version(s): Vaadin 23.2 (master) - haven't tested older versions yet
Browsers
Issue is not browser related
The text was updated successfully, but these errors were encountered: