You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem above is that it is referencing the global window object when performing its position calculations, instead of the parent window of the anchorEl prop. A quick fix for this could be to use Node.ownerDocument.defaultView if an anchorEl was provided, which returns the Window object.
Steps to Reproduce (for bugs)
See https://codesandbox.io/s/6lqo45vzvk. You can see that the menu is positioned correctly within the main window relative to the button, however in the popout window the menu overflows the parent window.
Context
After testing the rewrite of the Portal component following my previous issue #9207, I noticed the Popover positioning issue within the second window.
Your Environment
Tech
Version
Material-UI
1.0.0-beta.30
React
16
browser
all
etc
The text was updated successfully, but these errors were encountered:
Expected Behavior
The Popover doesn't overflow the
anchorEl
parent window when being positioned.Current Behavior
Popover.getPositioningStyle
contains logic to position the popover relative to theanchorEl
prop. It currently uses the globalwindow
object to get theinnerHeight
andinnerWidth
when calculating if the Popover is overflowing the window:https://github.com/mui-org/material-ui/blob/c3afd7bb33fa26e465dc333449e9449a4bb9e7bd/src/Popover/Popover.js#L123-L125
The problem above is that it is referencing the global window object when performing its position calculations, instead of the parent window of the
anchorEl
prop. A quick fix for this could be to useNode.ownerDocument.defaultView
if ananchorEl
was provided, which returns theWindow
object.Steps to Reproduce (for bugs)
See https://codesandbox.io/s/6lqo45vzvk. You can see that the menu is positioned correctly within the main window relative to the button, however in the popout window the menu overflows the parent window.
Context
After testing the rewrite of the Portal component following my previous issue #9207, I noticed the Popover positioning issue within the second window.
Your Environment
The text was updated successfully, but these errors were encountered: