Skip to content

Commit 6bd559f

Browse files
authored
Patch fix Rooster Plugins 9.24.1 (#2995)
* Check editor disposed before executing function when on blur (#2994)
1 parent 8e54faa commit 6bd559f

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

packages/roosterjs-content-model-plugins/lib/imageEdit/ImageEditPlugin.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export class ImageEditPlugin implements ImageEditor, EditorPlugin {
104104
this.disposer = editor.attachDomEvent({
105105
blur: {
106106
beforeDispatch: () => {
107-
if (this.editor) {
107+
if (this.isEditing && this.editor && !this.editor.isDisposed()) {
108108
this.applyFormatWithContentModel(
109109
this.editor,
110110
this.isCropMode,
@@ -142,13 +142,13 @@ export class ImageEditPlugin implements ImageEditor, EditorPlugin {
142142
* called, plugin should not call to any editor method since it will result in error.
143143
*/
144144
dispose() {
145-
this.editor = null;
146-
this.isEditing = false;
147-
this.cleanInfo();
148145
if (this.disposer) {
149146
this.disposer();
150147
this.disposer = null;
151148
}
149+
this.isEditing = false;
150+
this.cleanInfo();
151+
this.editor = null;
152152
}
153153

154154
/**

versions.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@
22
"react": "9.0.2",
33
"main": "9.24.0",
44
"legacyAdapter": "8.63.2",
5-
"overrides": {}
5+
"overrides": {
6+
"roosterjs-content-model-plugins": "9.24.1"
7+
}
68
}

0 commit comments

Comments
 (0)