File tree Expand file tree Collapse file tree 4 files changed +8
-7
lines changed Expand file tree Collapse file tree 4 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -1061,12 +1061,13 @@ export class BlockNoteEditor<
10611061 return extension ;
10621062 }
10631063 /**
1064- * Mount the editor to a parent DOM element.
1064+ * Mount the editor to a DOM element.
10651065 *
10661066 * @warning Not needed to call manually when using React, use BlockNoteView to take care of mounting
10671067 */
1068- public mount = ( parentElement : HTMLElement ) => {
1069- this . _tiptapEditor . mount ( parentElement ) ;
1068+ public mount = ( element : HTMLElement ) => {
1069+ // TODO: Fix typing for this in a TipTap PR
1070+ this . _tiptapEditor . mount ( { mount : element } as any ) ;
10701071 } ;
10711072
10721073 /**
Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ export class FormattingToolbarView implements PluginView {
9999 return ;
100100 }
101101
102- const editorWrapper = this . pmView . dom . parentElement ! . parentElement ! ;
102+ const editorWrapper = this . pmView . dom . parentElement ! ;
103103
104104 // Checks if the focus is moving to an element outside the editor. If it is,
105105 // the toolbar is hidden.
@@ -127,7 +127,7 @@ export class FormattingToolbarView implements PluginView {
127127 if ( ! element ) {
128128 return false ;
129129 }
130- const editorWrapper = this . pmView . dom . parentElement ! . parentElement ! ;
130+ const editorWrapper = this . pmView . dom . parentElement ! ;
131131 if ( ! editorWrapper ) {
132132 return false ;
133133 }
Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ class LinkToolbarView implements PluginView {
119119 } ;
120120
121121 clickHandler = ( event : MouseEvent ) => {
122- const editorWrapper = this . pmView . dom . parentElement ! . parentElement ! ;
122+ const editorWrapper = this . pmView . dom . parentElement ! ;
123123
124124 if (
125125 // Toolbar is open.
Original file line number Diff line number Diff line change @@ -571,7 +571,7 @@ export class SideMenuView<
571571 this . mousePos . y < editorOuterBoundingBox . bottom ;
572572
573573 // TODO: remove parentElement, but then we need to remove padding from boundingbox or find a different solution
574- const editorWrapper = this . pmView . dom ! . parentElement ! . parentElement ! ;
574+ const editorWrapper = this . pmView . dom ! . parentElement ! ;
575575
576576 // Doesn't update if the mouse hovers an element that's over the editor but
577577 // isn't a part of it or the side menu.
You can’t perform that action at this time.
0 commit comments