-
-
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
Dialog backdrop is persisted when initialized as open but then immediately closed #12831
Comments
After you set open to false it does not set exited property of modal to true. So hidden class does not applied and dialog covers all area. Am I right? @kamranayub I think that Now i have a bigger problem: My daughter wants play with me:). So maybe later i will debug it. @oliviertassinari: Please verify us , are we in right way? |
As far as I could look into the issue, it's not related to the backdrop. You can remove it and still experience the problem. The
So, we have it, it's a rendering order issue. We need the transition to render once with I will leave you with that 😴 |
@mbrn are you working on this? |
@nathanmarks i will. |
Thanks for your help!
…On Mon, Sep 10, 2018, 22:54 Mehmet Baran ***@***.***> wrote:
@nathanmarks <https://github.com/nathanmarks> i will.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#12831 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAiaa_VdQUCG2r2rI72pRSFOHBhS03x2ks5uZzPhgaJpZM4WhzCx>
.
|
@oliviertassinari You are right. When i change disablePortal props of Modal to true, the problem is being solved. Should i send disablePortal:true to Modal from Dialog or make Modal's default disablePortal value true? What do you offer? @nathanmarks @oliviertassinari |
Please don't. It was just to identify what's going on. If few people are affected by this issue, @kamranayub and others can stick to the |
ok @oliviertassinari. @kamranayub you can set disablePortal={true} to solve your problem. |
I'll try it out today.
…On Tue, Sep 11, 2018, 01:26 Mehmet Baran ***@***.***> wrote:
ok @oliviertassinari <https://github.com/oliviertassinari>. @kamranayub
<https://github.com/kamranayub> you can set disablePortal={true} to solve
your problem.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#12831 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAiaa3cEfgSzHmwM5wEXiYUJQ5aP0Re1ks5uZ1emgaJpZM4WhzCx>
.
|
I actually managed to remove the need for a dialog in my use case so I'm no longer affected by this. I can close and if someone else finds a need for a fix, can re-open perhaps. |
Re-opening this since it's a legitimate bug |
Sure, no problem. |
This should address mui#12831. After following the comments in the above issue, I indeed noticed that `onExited` was not called. However, I've also noticed that `onEntered` was not called either. This is because the transition is not even rendered. To solve this, I have added a flag that tells if the transition was entered. If this is not the case, we can remove the modal from the DOM when open is false.
This should address mui#12831. After following the comments in the above issue, I indeed noticed that `onExited` was not called. However, I've also noticed that `onEntered` was not called either. This is because the transition is not even rendered. To solve this, I have added a flag that tells if the transition was entered. If this is not the case, we can remove the modal from the DOM when open is false.
* Modal: prevent backdrop to stay open when 'open' is flickering This should address #12831. After following the comments in the above issue, I indeed noticed that `onExited` was not called. However, I've also noticed that `onEntered` was not called either. This is because the transition is not even rendered. To solve this, I have added a flag that tells if the transition was entered. If this is not the case, we can remove the modal from the DOM when open is false. * [Modal] Fix exited state
This comment has been minimized.
This comment has been minimized.
I have just encountered this issue after upgrading from v5.10.0 to v5.11.10. My issue is similar to @kamranayub, I am not using transitions, but have a situation where the dialog open state is immediately changing from true to false after the app launches. I agree with @megphillips91 that this issue should perhaps be reopened. Although, I was able to solve my issue using the suggested |
This should not be a duplicate of the transition issue as I'm not using a Transition, this is a default Dialog component (reproduced below using the Component API Demo page).
Essentially I think flipping the
open
prop too quickly results in the backdrop being persisted. I know ideally I should get it to initialize with the right value, but the prop is driven off of Redux and initially I won't have the updated state until some other components that handle stuff are run (this is auth related, so validating tokens and stuff all happens outside this component).Expected Behavior
When dialog is mounted initially with open
true
and then immediately reset back tofalse
, backdrop should not be shown or block UI.Current Behavior
When Dialog is initially mounted as
open={true}
but then immediately set tofalse
(in my case, due togetDerivedStateFromProps
that flips it immediately due to business logic), the UI backdrop is still being persisted and blocks the UI.Steps to Reproduce
I changed the demo file to start with
open
set totrue
and then on mount, set it tofalse
to emulate the situation I'm in.Link: https://codesandbox.io/s/14w19w1px4
Context
Your Environment
The text was updated successfully, but these errors were encountered: