From 8abb1a56d7c0a000cda5108382222f29baaf1bd7 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Mon, 24 Jun 2024 14:53:53 +0200 Subject: [PATCH] Reuse text element computed styles if applicable --- service.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/service.js b/service.js index b6ada28..e123081 100644 --- a/service.js +++ b/service.js @@ -332,7 +332,10 @@ class BesService { this.correctionPanel.style.paddingRight = styles.paddingRight this.scrollPanel.style.width = `${this.textElement.scrollWidth}px` if (this.isHostElementInline()) { - const hStyles = window.getComputedStyle(this.hostElement) + const hStyles = + this.hostElement !== this.textElement + ? window.getComputedStyle(this.hostElement) + : styles const totalWidth = parseFloat(styles.paddingLeft) + parseFloat(styles.marginLeft) +