nested submenus at screen edge will overlap
- Dominant language
- Rust
- Stars
- 30.6k
- Forks
- 2.1k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 72
Description
Submenus are usually created to the right side of the parent menu:

If the right screen edge is hit, then the submenus will be placed with their right edge matching the screen edge:

In the shown example this will cause a not so optimal appearance, i.e. the submenu will partially cover the parent menu.
If the submenu has a long text, this will cause the submenu to fully overlap the parent menu. This will effectively prohibit the user to move on to the next item in the parent menu, as it is covered and not accessible. I therefore consider this behavior a bug.
This is an example from my application:

**Expected behavior**
If the space between the right edge of the parent menu and the screen is smaller than the width of the submenu, then the submenu should be displayed to the left side of the parent menu.
It could look similar to this:

I checked with LibreOffice and other applications and it seems a common way to handle this.
I would _really_ appreciate any help on this subject, as this is an annoying behavior in my application. Thank you!
Contributor guide
Research direction
The issue does not name files, tests, or entry points. Start by locating egui's submenu placement and screen-edge handling, then reproduce the reported nested-menu case with a submenu wider than the available space. Done means the submenu moves to the parent menu's left side when it cannot fit on the right, without breaking normal placement.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- desktop, frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100