Call confirmAlert box from another confirmAlert
See original GitHub issueFirst off, I have been loving confirmAlert and use it all over in my app so thank you.
Right now, I am trying to open a confirmAlert box upon a user clicking a button in a prior confirmAlert box (which should close). However, the second confirmAlert box doesn’t open, probably because the first one is still exiting the DOM.
I see there’s a callback function for willUnmount()
(which doesn’t work for triggering the second confirmAlert, probably because the first confirmAlert hasn’t quite unmounted yet) but if there were a callback for afterClose()
or something, then I could use that for opening the second one. Is this a feature that will be supported?
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (3 by maintainers)
Top Results From Across the Web
jQuery : How to call another function on confirm box return value
I am using sweet alert plugin, may be getting problem from that. My confirm function is given below. function confirm(title) { var returnType...
Read more >Window confirm() Method - W3Schools
The confirm() method displays a dialog box with a message, an OK button, and a Cancel button. The confirm() method returns true if...
Read more >JavaScript confirm alert box: fancy and simple with 5 online ...
A confirm alert is a type of alert box where a user is asked before taking a certain action. A simple JavaScript confirm...
Read more >JavaScript Message Boxes: alert(), confirm(), prompt()
JavaScript Message Boxes: alert(), confirm(), prompt(). JavaScript provides built-in global functions to display popup message boxes for different purposes.
Read more >Window.confirm() - Web APIs - MDN Web Docs
confirm () instructs the browser to display a dialog with an optional message, and to wait until the user either confirms or cancels...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes if you’re using
state
in yoursetConfirmAbort()
function then you could be right. You could try with a member variable like I did and/or add someconsole.log()
s to see whenconfirmAbort
actually gets set, maybe adding in someasync/await
in there if you really need to usestate
.@mdodge-ecgrow, here is how I’ve used it (I wasn’t using the
customUI
but it should work the same):Then in
this.removeCommentForRealz()
you can call anotherconfirmAlert()
. Hope that helps!