question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Closing the current modal while opening other

See original GitHub issue

I am opening an modal upon pressing a button from another modal and would need to close previously opened modal.

Please assist. below code doesn’t work.

<Button onPress={this.confirmOrder} title="CONFIRM" />

confirmOrder = () => { const { modal: { openModal, closeModal }, } = this.props; closeModal; openModal('NewOrderPost'); };

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
syedirfan33commented, Aug 23, 2019

Omg it’s working, thanks a lot!!

0reactions
CharlesMangwacommented, Aug 23, 2019

Oh my bad @syedirfan33! After reading your initial message again I think I’ve found where your issue might come from: you wrote closeModal; instead of actually calling the function via closeModal();, that’s why nothing is happening.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bootstrap modal: close current, open new - Stack Overflow
For Bootstrap v4 ... You can toggle between modals by having putting data-dismiss="modal" and data-toggle="modal" in the same HTML element. You'd also need...
Read more >
Bootstrap : Close current and open a new modal window
Bootstrap : Close current and open a new modal window. This is very basic requirement to open second modal window by clicking on...
Read more >
How to close one bootstrap modal form if another o...
I have been looking around at how to close one bootstrap modal when another opens, but none of the solutions seem to work....
Read more >
Close modal and open new modal
I am trying to create a script that shows my login modal on page load. I have a button that opens the register...
Read more >
Bootstrap modal: close current, open new - CodePen
A proper and clean way to get this done without addtional Javascript/jQuery. The main purpose of this demo is was to answer this...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found