Skip to content

Before exit modal when user has unsaved changes

We provide an option for optionally disable the pop-up modal before user exits the editor.

You can disable the functionality by adding this line to Topol Options:

js
showUnsavedDialogBeforeExit: false,

To track if user has unsaved changes within the editor, Editor fires a callback every time the state of unsaved changes from true to false and otherwise

ts
onEdittedWithoutSaveChanged(changedTo: boolean)

You can then use this obtained value in your state and show custom exit modal when user is about to leave an editor with unsaved changes.