-
Notifications
You must be signed in to change notification settings - Fork 74
Open
Labels
Impact: LowSeverity: MinorbugSomething isn't workingSomething isn't workingneeds discussionNo decision yet, discussion neededNo decision yet, discussion neededvaadin-ordered-layout
Description
Description
When adding elements to a HorizontalLayout with addComponentToIndex, if the index provided is greater than the last existing index in the layout, the element always ends up in the left/default slot.
This is clearly caused by the slot being simply ignored if no component exists at the given index:
Line 330 in dc62c93
| : null; |
Expected outcome
Would expect the element to be placed in whatever slot the last (i.e. end-most) existing element is in.
Minimal reproducible example
One would expect this to place Button 4 in the end slot, but it ends up in the left/default slot:
HorizontalLayout hz = new HorizontalLayout();
hz.add(new Button("1"));
hz.addToEnd(new Button("2"));
hz.addToEnd(new Button("3"));
hz.addComponentAtIndex(hz.getComponentCount()), new Button("4"));Steps to reproduce
- Add one or more components to the middle or end slot of a HorizontalLayout
- Add another component using
addComponentAtIndex, providing an index >= the current component count - Observe the newly added component being in the left/default slot instead of after the last previously added component
Environment
Vaadin version(s): V25.0
Browsers
Issue is not browser related
Metadata
Metadata
Assignees
Labels
Impact: LowSeverity: MinorbugSomething isn't workingSomething isn't workingneeds discussionNo decision yet, discussion neededNo decision yet, discussion neededvaadin-ordered-layout