I’m using Vaadin 24.2.3. I have a SideNav (as suggested in the documentation, in a Scroller put into the drawer of an AppLayout) with two SideNavItem, each with sub items (so, a two level structure). Problem is, the first SideNavItem, when expanded overlaps the second. I attach two images with the “First” SideNavItem not expanded and expanded.
Here is the code, very basic:
SideNav sideNav = new SideNav();
sideNav.setCollapsible(false);
sideNav.setExpanded(true);
sideNav.setSizeFull();
SideNavItem firstSideNavItem = new SideNavItem("First");
firstSideNavItem.setExpanded(true);
firstSideNavItem.addItem(new SideNavItem("First-First", FFView.class));
firstSideNavItem.addItem(new SideNavItem("First-Second", FSView.class));
firstSideNavItem.addItem(new SideNavItem("First-Third", FTView.class));
sideNav.addItem(firstSideNavItem);
SideNavItem secondSideNavItem = new SideNavItem("Second");
secondSideNavItem.setExpanded(true);
secondSideNavItem.addItem(new SideNavItem("Second-First", SFView.class));
secondSideNavItem.addItem(new SideNavItem("Second-Second", SSView.class));
secondSideNavItem.addItem(new SideNavItem("Second-Third", STView.class));
sideNav.addItem(secondSideNavItem);
Div div = new Div(sideNav);
div.setSizeFull();
addToDrawer(scroller);
I used both Chromium and Edge, same result.
I checked the CSS of the <vaadin-side-nav-item>
elements (in particular the “First-First” one) but I wasn’t able to see anything that (AFAIK) produces the overlap. For example. the “display” is always “block”.
Changing the setExpanded(true)
to false
does not change. Even creating a root SideNavItem and putting “First” and “Second” under it does not change. Of course, I performed a maven clean and the Vaadin dance and restarted the IDE (IntelliJ) multiple times.
Does someone have any hint? I haven’t found a related SideNav bug issue in GitHub, nor any message here in Discord. Is there something I’m missing?
Thanks a lot.