Skip to content

Fix contextmenu submenu overflow while preserving expected anchor position#2817

Open
bluegaspode wants to merge 1 commit into
vakata:masterfrom
tecease-gmbh:fix/contextmenu-vertical-overflow
Open

Fix contextmenu submenu overflow while preserving expected anchor position#2817
bluegaspode wants to merge 1 commit into
vakata:masterfrom
tecease-gmbh:fix/contextmenu-vertical-overflow

Conversation

@bluegaspode
Copy link
Copy Markdown

We want to provide a fix we recently applied to jstree and could improve things also for other users.

  • Previously, when a submenu overflowed the viewport bottom, jsTree forced bottom: -1px, which could relocate the submenu to the very top of the window and allow clipping at the top.
  • This change switches to overflow-based vertical margin adjustment, improving the chance that the full submenu is visible in constrained vertical space. i.e. the submenu is first aligned to the parent menu opening it and moved up until fully visible.
  • The new positioning keeps the submenu as close as possible to where users expect it, instead of snapping to a bottom-aligned position.

…ition

- Previously, when a submenu overflowed the viewport bottom, jsTree forced bottom: -1px, which could relocate the submenu far from the hovered item and still allow clipping at the top.
- This change switches to overflow-based vertical margin adjustment, improving the chance that the full submenu is visible in constrained vertical space.
- The new positioning keeps the submenu as close as possible to where users expect it, instead of snapping to an unrelated bottom-aligned position.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant