Confirmation on modal close

  • 12 March 2021
  • 2 replies
  • 166 views

Dear Miro team,

My users need to edit a text in modal, after the edition is done, they may forget to save the changes, and the changes should not be lost by their reckless clicks on somewhere outside of the modal (which causes the modal to be closed).

Can I listen ‘to on modal close event’ and ask the user to confirm closing the editor?

Thanks,

Mohsen Bazmi


2 replies

Userlevel 4
Badge

Hello @Mohsen,

Unfortunately, the SDK does not have an event for modal close. Here’s the list of all the supported events:
https://developers.miro.com/docs/namespace-sdk#section-event-type

 

I’m not sure how other developers are tackling this issue. Maybe implementing autosave functionality for your modal would be a good idea?
 

Kind regards.

 

Daniela

Userlevel 7
Badge +5

@Daniela Gavidia @Mohsen  
 

I found these little lines in the SDK ref today as I was looking for the same thing but for the ‘library’ … 

https://github.com/miroapp/app-examples/blob/3cca5f4567cc3da9517044ac604e354981bb3d47/miro.d.ts#L868

Haven’t tested or implemented it… 
It gives me the feeling that it might work similarly to an event listener. 


Thoughts on the behavior we might expect from that promise resolving? 
 

 

Reply