eBay / eBay/nice-modal-react

hide Promise does not resolve if Modal is already hidden

Open
#139 1 comment 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
2.3k
Forks
127
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the hide(MyModal1).then(() => show(MyModal2)) sequence with MyModal1 already hidden, then trace the hide and show entry points. Done means hide resolves whether or not MyModal1 is visible and MyModal2 is shown in both cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.