File tree Expand file tree Collapse file tree 3 files changed +16
-2
lines changed
src/components/modules/toolbar Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 11# Changelog
22
3+ ### 2.31.1
4+
5+ - ` Fix ` - Prevent the warning from appearing when ` readOnly ` mode is initially set to ` true `
6+
37### 2.31.0
48
59- ` New ` - Inline tools (those with ` isReadOnlySupported ` specified) can now be used in read-only mode
Original file line number Diff line number Diff line change 11{
22 "name" : " @editorjs/editorjs" ,
3- "version" : " 2.31.0 " ,
3+ "version" : " 2.31.1 " ,
44 "description" : " Editor.js — open source block-style WYSIWYG editor with JSON output" ,
55 "main" : " dist/editorjs.umd.js" ,
66 "module" : " dist/editorjs.mjs" ,
Original file line number Diff line number Diff line change @@ -68,6 +68,11 @@ export default class BlockSettings extends Module<BlockSettingsNodes> {
6868 return 'flipper' in this . popover ? this . popover ?. flipper : undefined ;
6969 }
7070
71+ /**
72+ * Flag that indicates whether the `EditorMobileLayoutToggled` event listener is attached.
73+ */
74+ private hasMobileLayoutToggleListener = false ;
75+
7176 /**
7277 * Page selection utils
7378 */
@@ -92,6 +97,7 @@ export default class BlockSettings extends Module<BlockSettingsNodes> {
9297 }
9398
9499 this . eventsDispatcher . on ( EditorMobileLayoutToggled , this . close ) ;
100+ this . hasMobileLayoutToggleListener = true ;
95101 }
96102
97103 /**
@@ -100,7 +106,11 @@ export default class BlockSettings extends Module<BlockSettingsNodes> {
100106 public destroy ( ) : void {
101107 this . removeAllNodes ( ) ;
102108 this . listeners . destroy ( ) ;
103- this . eventsDispatcher . off ( EditorMobileLayoutToggled , this . close ) ;
109+
110+ if ( this . hasMobileLayoutToggleListener ) {
111+ this . eventsDispatcher . off ( EditorMobileLayoutToggled , this . close ) ;
112+ this . hasMobileLayoutToggleListener = false ;
113+ }
104114 }
105115
106116 /**
You can’t perform that action at this time.
0 commit comments