<OverflowMenu floatingMenu> rendered position is off in v9 #2907
Labels
component: overflow-menu
severity: 3
https://ibm.biz/carbon-severity
type: bug 🐛
version: 9
Issues pertaining to legacy Carbon
What package(s) are you using?
carbon-components
carbon-components-react
Detailed description
When using
<OverflowMenu floatingMenu>
, Carbon looks for an ancestor element with attributedata-floating-menu-container
and renders the menu contents inside that element. If that element is relatively positioned, the positioning of the menu contents is wrong.Here's a minimal reproduction:
And here's a screenshot of what I see:
Note how the vector from the top left corner of the screen to the bottom midpoint of the menu icon is the same as the vector from the bottom midpoint of the menu icon to the tip of the arrow in the menu body. This indicates that the menu body is being positioned relative to its nearest positioned ancestor (the yellow
<div>
) but the calculations for its position assume that it is being positioned relative to<body>
.<OverflowMenu>
I expected the menu contents' position to be beneath the menu icon, with the tip of the arrow pointing at the bottom midpoint of the menu icon.
Chrome
V9 (so that's
carbon-components-react@6
Related: #2876.
The text was updated successfully, but these errors were encountered: