Close Top Most Modal

I have a page include inside a modal. The page include has a button which has the last action “Close Topmost Modal”. With “Close Topmost Popup” in V1 it would close the topmost popup.

Is this expected?

  • V2 Page Includes are more completely isolated from their parents. So the action you trigger in the page include is not going to affect the modal spawned by the parent page. The tool we use to get around that is events. Events can be set to be global - published and listened from all the skuid pages that are currently active in the browser window.

    Your action in the page include should be to publish an event. Just call it “CloseModal”

  • Then in your parent page create an action sequence that is triggered by the "CloseModal" event that actually does the modal closing..

Its a bit of a complication, but there are plenty of benefits of the more complete isolation we have introduced for V2. We feel the tradeoff was fair.

Thanks Rob. Very nice.

Thanks for this detail! I am trying the same thing presently in V2.

1 Like