I've got a Marionette.Layout that manages a bunch of region sub-views that contain information I'd like to save before the user navigates away from the page. I was using onBeforeClose()
in the Layout, but the regions seem to be closed and removed before the Layout is. Further, it doesn't seem like returning false
in onBeforeClose()
can prevent destruction of sub-views either. Any thoughts on whether there is an alternative approach or whether Marionette's onBeforeClose()
should be called earlier?
Others have suggested detecting changes before the close happens, but as mentioned here (Prevent Marionette view from close onBeforeClose) it doesn't capture all the close cases.