diff --git a/libs/ngx-blocknote/src/lib/components/formatting-toolbar/bna-formatting-toolbar-controller.component.ts b/libs/ngx-blocknote/src/lib/components/formatting-toolbar/bna-formatting-toolbar-controller.component.ts index 2a7659c..ee140a9 100644 --- a/libs/ngx-blocknote/src/lib/components/formatting-toolbar/bna-formatting-toolbar-controller.component.ts +++ b/libs/ngx-blocknote/src/lib/components/formatting-toolbar/bna-formatting-toolbar-controller.component.ts @@ -50,15 +50,17 @@ export class BnaFormattingToolbarControllerComponent { cleanup(); //TODO: remove auto update //had the problem that the first set position was not good - cleanup = autoUpdate( - getVirtualElement(formattingToolbar.referencePos), - this.elRef.nativeElement, - async () => { - await this.updateFormattingToolbarPosition( - formattingToolbar.referencePos, - ); - }, - ); + if(formattingToolbar.show){ + cleanup = autoUpdate( + getVirtualElement(formattingToolbar.referencePos), + this.elRef.nativeElement, + async () => { + await this.updateFormattingToolbarPosition( + formattingToolbar.referencePos, + ); + }, + ); + } }); }