@@ -242,21 +242,11 @@ export class SideMenuView<
242
242
243
243
this . hoveredBlock = block . node ;
244
244
245
- // Gets the block's content node, which lets to ignore child blocks when determining the block menu's position.
246
- // TODO: needed?
247
- const blockContent = block . node . firstChild as HTMLElement ;
248
-
249
- if ( ! blockContent ) {
250
- return ;
251
- }
252
-
253
- // TODO: needed?
254
-
255
245
// Shows or updates elements.
256
246
if ( this . editor . isEditable ) {
257
- const blockContentBoundingBox = blockContent . getBoundingClientRect ( ) ;
247
+ const blockContentBoundingBox = block . node . getBoundingClientRect ( ) ;
258
248
const column = block . node . closest ( "[data-node-type=column]" ) ;
259
- this . updateState ( {
249
+ this . state = {
260
250
show : true ,
261
251
referencePos : new DOMRect (
262
252
column
@@ -275,7 +265,8 @@ export class SideMenuView<
275
265
block : this . editor . getBlock (
276
266
this . hoveredBlock ! . getAttribute ( "data-id" ) ! ,
277
267
) ! ,
278
- } ) ;
268
+ } ;
269
+ this . updateState ( this . state ) ;
279
270
}
280
271
} ;
281
272
@@ -435,9 +426,9 @@ export class SideMenuView<
435
426
// We need to check if there is text content that is being dragged (select some text & just drag it)
436
427
const textContentIsBeingDragged =
437
428
! event . dataTransfer ?. types . includes ( "blocknote/html" ) &&
438
- Boolean ( this . pmView . dragging ) ;
429
+ ! ! this . pmView . dragging ;
439
430
// This is the side menu drag from this plugin
440
- const sideMenuIsBeingDragged = Boolean ( this . isDragOrigin ) ;
431
+ const sideMenuIsBeingDragged = ! ! this . isDragOrigin ;
441
432
// Tells us that the current editor instance has a drag ongoing (either text or side menu)
442
433
const isDragOrigin = textContentIsBeingDragged || sideMenuIsBeingDragged ;
443
434
0 commit comments