[Popover] Reposition when rerender
See original GitHub issue- I have searched the issues of this repository and believe that this is not a duplicate.
Expected Behavior
If the <Select>
component is opened, and we are loading its items dynamically, it’s expected that when the items are finally loaded the <Select>
's opened overlay adjusts itself to the current available space.
Current Behavior
The <Select>
's overlay overflows.
Steps to Reproduce (for bugs)
In the sandbox, click on the <Select>
and wait for it to load.
https://codesandbox.io/s/vqvm1704q3
Your Environment
Tech | Version |
---|---|
Material-UI | 1.0.0-beta.35 |
React | 16.2.0 |
browser | Google Chrome 64.0.3282.186 |
Issue Analytics
- State:
- Created 6 years ago
- Reactions:5
- Comments:12 (6 by maintainers)
Top Results From Across the Web
[Popover] Reposition when rerender #10595 - mui/material-ui
If the <Select> component is opened, and we are loading its items dynamically, it's expected that when the items are finally loaded the...
Read more >Bootstrap 4 - how does automatic Popover re-positioning work?
First, click the green button to open the popover. Then use button 2 to move the popover toggle. Now the toggle and the...
Read more >Popover - Chakra UI
Even though you specified the placement, Popover will try to reposition itself in the event that available space at the specified placement isn't...
Read more >Popover API - Material UI - MUI
Name Type Default
open * bool false
action ref
anchorEl HTML element | func
Read more >How to Position a React-Bootstrap Popover - Pluralsight
In this guide, you'll learn how to use a popover component from the ... The placement prop defines the position of your popover....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@KevinAsher We have added an
action
prop to the Popover component since to solve the problem. You can trigger the.updatePosition()
method when you need to update the position of the Popover (it was added in #9588)For instance:
However, it might require too much boilerplate, a workaround is to trigger a window resize event (don’t abuse it!):
In the future, we should consider using the ResizeObserver API for out of the box support:
Alternatively, we can consider updating the position at each render. It could be a low hanging fruit 😃.
How to use this?