-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[Bug]: #881
Comments
Temporary solution to the problem: Upon submit form within Modal, wrap the success alert within a timeout (I set it to 500ms), so that we give the DOM some time to remove the |
Hey! Thank you for your bug report! I don't think this is an issue anymore, but can you double check that by bumping to the latest version of Headless UI? If this issue still occurs, can you create a new issue with a minimal reproduction repo attached? |
I'm facing same issue with version 1.4.3. After the Modal Dialog is opened, the element gets overflow: hidden. However, when Model Dialog is closed, overflow:hidden is not removed from html element. Should I remove it manually? |
@okbill can you create a reproduction repo and open a new issue? |
@okbill If you create a new issue do you mind tagging me or including the issue number here as well. Yes, I’m still able to reproduce @RobinMalfait would it be possible to re-open this issue? |
I get same issue |
Same issue for me, please reopen. |
If this is still a problem for anyone, please open a new issue with a proper reproduction Repo / CodeSandbox attached so that we can take a look at the problem. |
What package within Headless UI are you using?
@headlessui/react
What version of that package are you using?
1.4.1
What browser are you using?
Chrome
Reproduction repository
none
Describe your issue
I'm using the following Context Provider to handle two dialog states:
The Modal provider opens a Dialog with a form that when submitted adds products to the user's cart.
The Alert provider opens a Dialog - Alert Popup.
In the following scenario, a user intends to add a product to their cart. The Modal Dialog is set to
open
. Upon submission the Modal Dialog is set tofalse
to disable and close the Dialog.After the Modal Dialog is set to close, I set the Alert Provider to open, in order to display a Success Alert to the user confirming their product has been added to their cart.
The issue is the following:
After the Modal Dialog is closed and the Alert Dialog opens, the
<html>
element getsoverflow: hidden
. This is usually expected, but not once a user clicks to close the Dialog. In my case I close the Alert Dialog, but theoverflow: hidden
is added on the close. As you can tell in the GIF below, while the Alert Dialog is open a user can scroll. But once he/she closes the Dialog, the user can no longer scroll. It seems that the order of the events are incorrect.Just to point out this error only happens in the case where a user submits the Modal Dialog form and then the Success Dialog appears.
The text was updated successfully, but these errors were encountered: