Skip to content
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

Modal overflow hidden issue #1764

Closed
philmetzger opened this issue Aug 12, 2022 · 7 comments
Closed

Modal overflow hidden issue #1764

philmetzger opened this issue Aug 12, 2022 · 7 comments
Assignees

Comments

@philmetzger
Copy link

So have a look at this issue: #881

Basically I have something similar (might not be the exact issue) but I was able to create a sandbox of the issue.

Check it out here: https://codesandbox.io/s/headless-ui-dialog-forked-ys0ktt?file=/src/App.tsx

The issue for me is when I have 2 modals and i want to go from 1 to the other.
Maybe there is something wrong with my implementation or a bug within headlessui?

@RobinMalfait RobinMalfait self-assigned this Aug 12, 2022
@RobinMalfait
Copy link
Member

Hey! Thank you for your bug report!
Much appreciated! 🙏

The short answer is that we currently don't support simultaneous Modals unless they are nested. In your case, due to the Transition, there is a moment in time where both Modals will be in an open state.

More information and some potential solutions can be found here: #1744 (comment)

@philmetzger
Copy link
Author

I would like to conclude I solved this with a short setTimeout between modals

@Makxzod
Copy link

Makxzod commented Dec 2, 2022

@philmetzger can u show a short snippet how you used setTimeout this way? I have exactly the same problem as you ;)

@philmetzger
Copy link
Author

Hey @hansens1927 unforunately as things go, things have changed, and i dont have that code anymore.

But maybe I can help. So I think the issue is the modal has some exit animation. So you have to kind of delay the next modal until the animation is done and then show the next moda. Hope this helps.

@Makxzod
Copy link

Makxzod commented Dec 2, 2022

@philmetzger how would u delay it?

@philmetzger
Copy link
Author

depends on how you are showing and hiding modals. But maybe something like this:

setShowModal(1) // first modal visible
setShowModal(null) // first modal hidden
setTimeout(() => setShowModal(2), 250); // second modal visible

Something like that I think

@Makxzod
Copy link

Makxzod commented Dec 2, 2022

@philmetzger Thank you for the fast replies, fixed it by doing what was here: #1698

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants