You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+31Lines changed: 31 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,34 @@
1
+
## 0.42.3 (2025-11-19)
2
+
3
+
### 🩹 Fixes
4
+
5
+
- disallow access to the `domElement` or `isFocused` if the editor is unmounted ([#2187](https://github.com/TypeCellOS/BlockNote/pull/2187))
6
+
7
+
### ❤️ Thank You
8
+
9
+
- Nick Perez
10
+
11
+
## 0.42.2 (2025-11-19)
12
+
13
+
### 🩹 Fixes
14
+
15
+
- put back mounting system ([#2183](https://github.com/TypeCellOS/BlockNote/pull/2183))
16
+
17
+
### ❤️ Thank You
18
+
19
+
- Nick Perez
20
+
21
+
## 0.42.1 (2025-11-18)
22
+
23
+
### 🩹 Fixes
24
+
25
+
- do not error on invalid `backgroundColor` or `textColor`#2176 ([#2179](https://github.com/TypeCellOS/BlockNote/pull/2179), [#2176](https://github.com/TypeCellOS/BlockNote/issues/2176))
26
+
- remove dependency array from comments re-rendering ([#2177](https://github.com/TypeCellOS/BlockNote/pull/2177))
Copy file name to clipboardExpand all lines: packages/core/src/editor/BlockNoteEditor.ts
+8-28Lines changed: 8 additions & 28 deletions
Original file line number
Diff line number
Diff line change
@@ -1054,40 +1054,14 @@ export class BlockNoteEditor<
1054
1054
* @warning Not needed to call manually when using React, use BlockNoteView to take care of mounting
1055
1055
*/
1056
1056
publicmount=(element: HTMLElement)=>{
1057
-
if(
1058
-
// If the editor is scheduled for destruction, and
1059
-
this.scheduledDestructionTimeout&&
1060
-
// If the editor is being remounted to the same element as the one which is scheduled for destruction,
1061
-
// then just cancel the destruction timeout
1062
-
this.prosemirrorView.dom===element
1063
-
){
1064
-
clearTimeout(this.scheduledDestructionTimeout);
1065
-
this.scheduledDestructionTimeout=undefined;
1066
-
return;
1067
-
}
1068
-
1069
1057
this._tiptapEditor.mount({mount: element});
1070
1058
};
1071
1059
1072
-
/**
1073
-
* Timeout to schedule the {@link unmount}ing of the editor.
1074
-
*/
1075
-
privatescheduledDestructionTimeout:
1076
-
|ReturnType<typeofsetTimeout>
1077
-
|undefined=undefined;
1078
-
1079
1060
/**
1080
1061
* Unmount the editor from the DOM element it is bound to
1081
1062
*/
1082
1063
publicunmount=()=>{
1083
-
// Due to how React's StrictMode works, it will `unmount` & `mount` the component twice in development mode.
1084
-
// This can result in the editor being unmounted mid-rendering the content of node views.
1085
-
// To avoid this, we only ever schedule the `unmount`ing of the editor when we've seen whether React "meant" to actually unmount the editor (i.e. not calling mount one tick later).
1086
-
// So, we wait two ticks to see if the component is still meant to be unmounted, and if not, we actually unmount the editor.
1087
-
this.scheduledDestructionTimeout=setTimeout(()=>{
1088
-
this._tiptapEditor.unmount();
1089
-
this.scheduledDestructionTimeout=undefined;
1090
-
},1);
1064
+
this._tiptapEditor.unmount();
1091
1065
};
1092
1066
1093
1067
/**
@@ -1108,10 +1082,16 @@ export class BlockNoteEditor<
0 commit comments