Skip to content

fix(context-menu): render menu inline and use viewport coordinates#314

Merged
nicolethoen merged 1 commit into
patternfly:mainfrom
lhein:120_fixCutContextMenus
May 12, 2026
Merged

fix(context-menu): render menu inline and use viewport coordinates#314
nicolethoen merged 1 commit into
patternfly:mainfrom
lhein:120_fixCutContextMenus

Conversation

@lhein

@lhein lhein commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

What

Closes #120

Description

This updates the topology context menu so it can flip correctly near the viewport edge.

The main change is that ContextMenu now renders a PatternFly Menu directly inside the topology popper instead of rendering a nested Dropdown with its own popper. This allows the outer topology popper to measure the actual menu height and position it correctly.

This PR also switches point-based context menu references in withContextMenu from pageX/pageY to clientX/clientY, which is consistent with viewport-based popper positioning.

Root cause

The visible context menu was effectively wrapped in a second popper layer. Because of that, the outer topology popper did not have reliable dimensions for the real menu content, so bottom-edge flipping did not work as expected.

Type of change

  • [ X] Bugfix

Screen shots / Gifs for design review

Before:
image
After:
image

@patternfly-build

patternfly-build commented Apr 13, 2026

Copy link
Copy Markdown

Signed-off-by: Lars Heinemann <lhein.smx@gmail.com>
@lhein lhein force-pushed the 120_fixCutContextMenus branch from 308d78c to 043b4c9 Compare April 13, 2026 07:43

@jeff-phillips-18 jeff-phillips-18 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks @lhein

@lordrip

lordrip commented May 8, 2026

Copy link
Copy Markdown
Contributor

thanks @jeff-phillips-18 @nicolethoen 🙏

@nicolethoen nicolethoen merged commit 610dfae into patternfly:main May 12, 2026
8 checks passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 6.5.0-prerelease.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Node context menu flip in case it's in the edge of diagram area

5 participants