-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[Popover][TopBar] Overlay width fix #2231
Conversation
b776dfc
to
297c43d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
@alex-page This bug was affecting us in Your fix seems to work 🎩 👍 |
297c43d
to
fe8819d
Compare
@@ -118,20 +119,30 @@ export class PositionedOverlay extends React.PureComponent< | |||
} | |||
|
|||
render() { | |||
const {left, top, zIndex, width} = this.state; | |||
const {render, fixed, classNames: propClassNames} = this.props; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing propClassNames
and not passing to classNames
below broke popover CSS transitions. I opened an issue for it #2310
Before | After |
---|---|
![]() |
![]() |
I just shipped v4.7.0 and v4.7.1 updates to web and noticed this where popover is rendering off canvas and causing horizontal scrolling in some cases: I’m not sure if this was a preexisting condition. @alex-page can you verify? |
I can re-create this as well, it definitely wasn't occurring previously. @alex-page was looking at this earlier today and it didn't appear off screen (I'm on chrome 77) |
This is caused by this PR. There is a bug with middle aligned popover on the right side of the page. I am looking into this now. |
WHY are these changes introduced?
Fixes #1673
WHAT is this pull request doing?
Using mutation observer so that the resize calculation is being run at the correct time. It is also resetting the left value to 0 which is needed for the recalc.
How to 🎩
🖥 Local development instructions
🗒 General tophatting guidelines
📄 Changelog guidelines
This needs to be tested in web and in Polaris with around 6-7 menu items.
Copy-paste this code in
playground/Playground.tsx
:🎩 checklist
README.md
with documentation changes