How to get modal confirm event on Miro SDK 2.0

  • 19 September 2022
  • 2 replies
  • 43 views

Badge +2

Hi everyone

I need to run some scripts when I click confirm button on the modal(setSnapshotNameModal.html)

So I used this scripts. If I click close button, it works but when l click confirm button, it doesn’t work.

Please let me know your thought.

Thank you


2 replies

Badge

Hi @Maxim Huryanov,

Thank you for reaching out, and for building with the Miro Web SDK!

The screenshot you shared shows how to open the modal. This code is usually in the headless iframe or in the panel iframe, if your app.

The modal should include the code to handle events associated with the OK and Cancel buttons on the modal that you're building. Is the logic to handle clicking OK and Cancel buttons in the modal code?  

For reference, you can see this article; they give a conceptual overview of how Miro apps are structured, and which iframe is relevant to running specific sections of the app code: 

This is the part of the article that is specific to the modal:

Badge +2

Hi @Marco Spinello 

Thanks for your reply.

Well I defined the handle events of OK and Cancel button on setSnapshotName.html.

I need to run some functionalities on main js when I click the OK button.

Above example, the console have to display “Modal Confirmed” when I press OK button.

But it doesn’t work. But If I press ✖ button, the console display “Modal confirmed”.

Please let me know how to solve this issue.

Thank you

Reply