Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ContextSubMenuItem): fix popper container #271

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

logonoff
Copy link

@logonoff logonoff commented Feb 4, 2025

What

Closes #270

Description

The root issue ended up being that Dropdown also implements a Popper, so although the topology portal goes to the correct element in the DOM, the portal inside the Dropdown goes to document.body. Since the Dropdown is a child of the topology popper, it takes precedence, causing the children to go to the body instead of its intended location

Type of change

  • Feature
  • Bugfix
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

Screen shots / Gifs for design review

Screencast.From.2025-02-04.10-42-29.mp4

@patternfly-build
Copy link

patternfly-build commented Feb 4, 2025

>
<Dropdown toggle={() => <></>} className={css(topologyStyles.topologyContextMenuCDropdownMenu)}>
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this class still needed?

Copy link
Author

Choose a reason for hiding this comment

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

It's also used here:

className={css(topologyStyles.topologyContextMenuCDropdownMenu)}

@@ -11,6 +11,11 @@ interface ContextSubMenuItemProps {
children: React.ReactNode[];
}

/** Check if an event target is also a node. Needed to stop runtime errors where the target does not implement Node. */
const isNode = (node: any): boolean => {
Copy link
Member

Choose a reason for hiding this comment

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

Can we rename this to isHTMLNode or something not to be confused with a Topology Node?

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.

Bug - ContextSubMenuItem - Dropdown menu not being displayed correctly
4 participants