From 5c47f58ec3017d22aafd2954062daaaa38dbaf40 Mon Sep 17 00:00:00 2001 From: Matthias risto Date: Tue, 17 Sep 2024 20:41:30 +0200 Subject: [PATCH] feat: set side menu to left-top on big block elements --- .../components/side-menu/bna-side-menu-controller.component.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/ngx-blocknote/src/lib/components/side-menu/bna-side-menu-controller.component.ts b/libs/ngx-blocknote/src/lib/components/side-menu/bna-side-menu-controller.component.ts index 5be6233..83ec6c1 100644 --- a/libs/ngx-blocknote/src/lib/components/side-menu/bna-side-menu-controller.component.ts +++ b/libs/ngx-blocknote/src/lib/components/side-menu/bna-side-menu-controller.component.ts @@ -59,12 +59,13 @@ export class BnaSideMenuControllerComponent { } private async getUpdateSideMenuPositionFn(referencePos: DOMRect) { + const placement = referencePos.height < 80 ? 'left' : 'left-start'; const result = await computePosition( getVirtualElement(referencePos), this.elRef.nativeElement, { strategy: 'fixed', - placement: 'left', + placement: placement, }, ); this.renderer2.setStyle(this.elRef.nativeElement, 'top', `${result.y}px`);