-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[Popper] Leverage ResizeObserver #22303
Comments
|
For #1 you can add the following
and this should fix this problem (https://codesandbox.io/s/practical-kalam-jz2ew?file=/src/Demo.js:2167-2232) with Material-UI v5 (Popper v2), the option is |
For 3. you could also just let the parent Popper component know when it's Child component updates using a callback function - https://codesandbox.io/s/loving-water-b9950?file=/src/Demo.js. You could also just nest the Child component in the Popper component too. Not sure if that would be more efficient than using a Ref but it might be easier. |
@mlizchap Thank you for the suggestions. While the first one is really helpful (and should probably be included in the docs) using the second one feels a bit weird - For example I would not expect that I have to pass an update to a Card when it's child is changing. Also in my case it's a bit harder as I deal with a form which updates in multiple occasions not just on a button click. @oliviertassinari regarding 2. what do you mean by definition? inside the docs it says: "Always keep the children in the DOM." - I would expect that the popper gets hidden simply but not that it adds whitespace at the bottom of the page.. Is there any way to prevent it? |
To clarify the "improvement" I have in mind behind the label: look into using |
Thank you for clarification. Wrapping the inner of the popper with |
As far as I understand from the previous conversation on this issue, 1 and 2 have already been resolved, and 3 is to be fixed. Am I correct? I cannot reproduce 3 as shown in the following recording. Screen.Recording.2021-08-16.at.09.41.00.mov |
@hbjORbj I have added a link to reproduction from your video. popper.js makes it work in v2 by using We can still reproduce when the content overflows: https://codesandbox.io/s/spring-tdd-2zxjw?file=/src/Demo.js overflow.mp4It's not really important to fix, but if the fix is low overhead, then why not :). |
https://codesandbox.io/s/practical-kalam-jz2ew?file=/src/Demo.js
open the popper by clicking on the button
The text was updated successfully, but these errors were encountered: