eBay / nice-modal-react

A modal state manager for React.
https://ebay.github.io/nice-modal-react
MIT License
2.1k stars 122 forks source link

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

Open vezaynk opened 11 months ago

vezaynk commented 11 months ago

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

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:

Actual result:

xeinebiu commented 10 months ago

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.