[AlertDialog] How to keep alert open for async functions? #991
-
Hi, I'm trying to create an alert dialog, to ask user a confirmation before updating some data in the server. I want the alert to stay open until the async call completes or fails. Currently any click to the I did a work around by not using |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hey @dheeraj-murali, I have answered another question here which I think is similar to what you are asking. Thanks! |
Beta Was this translation helpful? Give feedback.
-
@dheeraj-murali I just had a go at this to make sure the
Indeed... I would recommend always trying to use our parts because we may bind improved functionality/accessibility in future which you would lose out on if you used your own parts. |
Beta Was this translation helpful? Give feedback.
@dheeraj-murali I just had a go at this to make sure the
open
prop was still working correctly, and I think the missing part of your puzzle is that you need to addevent.preventDefault()
on the action click. All of our built in default behaviours can be prevented this way: https://codesandbox.io/s/condescending-stitch-9e0x0?file=/src/App.jsIndeed... I would recommend always trying to use our parts because we may bind improved functionality/accessibility in future which you would lose out on if you used your own parts.