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

hide Promise does not resolve if Modal is already hidden #139

Open
vezaynk opened this issue Dec 13, 2023 · 1 comment
Open

hide Promise does not resolve if Modal is already hidden #139

vezaynk opened this issue Dec 13, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@vezaynk
Copy link

vezaynk commented Dec 13, 2023

Lets say I have a button that I want to use for

  • closing a modal (if open)
  • opening a different modal

The way might it could would look like is:

hide(MyModal1).then(() => {
  show(MyModal2)
})

This code works if MyModal1 is current displayed. If it is not, then the hide() promise simply never resolves.

Expected result:

  • MyModal1 closes if open, and MyModal2 is shown

Actual result:

  • MyModal2 does not open if MyModal1 was not initially visible
@supnate supnate added the enhancement New feature or request label Dec 14, 2023
@xeinebiu
Copy link
Contributor

Lets say I have a button that I want to use for

* closing a modal (if open)

* opening a different modal

The way might it could would look like is:

hide(MyModal1).then(() => {
  show(MyModal2)
})

This code works if MyModal1 is current displayed. If it is not, then the hide() promise simply never resolves.

Expected result:

* MyModal1 closes if open, and MyModal2 is shown

Actual result:

* MyModal2 does not open if MyModal1 was not initially visible

Same issue is with Chakra Modals. hide never resolves.

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

No branches or pull requests

3 participants