From 0e11fa6cff870a71c475939ce15b5e56205c3bf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Ku=CC=88hn?= Date: Thu, 1 Apr 2021 12:12:23 +0200 Subject: [PATCH] remove transform --- .../extension-bubble-menu/src/bubble-menu-plugin.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/extension-bubble-menu/src/bubble-menu-plugin.ts b/packages/extension-bubble-menu/src/bubble-menu-plugin.ts index 66cd096d..13c46b5a 100644 --- a/packages/extension-bubble-menu/src/bubble-menu-plugin.ts +++ b/packages/extension-bubble-menu/src/bubble-menu-plugin.ts @@ -96,14 +96,20 @@ export class BubbleMenuView { const end = coordsAtPos(view, to, true) const parentBox = parent.getBoundingClientRect() const box = this.element.getBoundingClientRect() - const left = (start.left + end.left) / 2 - parentBox.left + const left = (start.left + end.left) / 2 - parentBox.left - box.width / 2 this.isActive = true this.top = Math.round(end.bottom - parentBox.top) this.bottom = Math.round(parentBox.bottom - start.top) this.left = Math.round( this.keepInBounds - ? Math.min(parentBox.width - box.width / 2, Math.max(left, box.width / 2)) + ? Math.min( + parentBox.width - box.width, + Math.max( + left, + 0, + ), + ) : left, ) @@ -119,7 +125,6 @@ export class BubbleMenuView { left: `${this.left}px`, // top: `${this.top}px`, bottom: `${this.bottom}px`, - transform: 'translateX(-50%)', }) }