Reuse text element computed styles if applicable

This commit is contained in:
Simon Rozman 2024-06-24 14:53:53 +02:00
parent e0b20b9030
commit 8abb1a56d7

View File

@ -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) +