Skip to content

Commit 98bc261

Browse files
authored
Fix: No alert when leaving the theme/plugin editor (#138)
1 parent ac1050b commit 98bc261

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/theme-plugin-editor/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ initLoader().then( ( monaco ) => {
4242
return;
4343
}
4444
textarea.value = editorValue;
45+
// Update the dirty state to display an alert when leaving the page.
46+
if ( window.wp && window.wp.themePluginEditor ) {
47+
window.wp.themePluginEditor.dirty = true;
48+
}
4549
} );
4650

4751
// Enable Emmet.

0 commit comments

Comments
 (0)