DEV Community

[Comment from a deleted post]
Collapse
 
elylucas profile image
Ely Lucas

Great article David!

One thing to add is to make sure you have a handler for onDidDismiss handler on the modal to set the open state back to false in case the user doesn't use the close button to dismiss the modal (they could just hit escape). That change in the open variable is what is used to kick off showing of the modal, so if it doesn't change back to false it won't open again when the user clicks the open button.

Collapse
 
daviddalbusco profile image
David Dal Busco

So true, I should have thought about trying to close the modal using Esc or dismissing through a click on the backdrop. Well spotted Ely, thank you for the feedback!

Collapse
 
daviddalbusco profile image
David Dal Busco

I have updated the article to reflect your comment, thank you Ely 👍