Skip to content

Commit 5a0229b

Browse files
committed
Rotation changes display inline to inline-block - should be safe since width is also set
1 parent 991e155 commit 5a0229b

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

app/components/selection/rotation.element.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@ export class Rotation extends HTMLElement {
1414

1515
set position({el}) {
1616
this.targetElement = el
17+
18+
const computedStyle = getComputedStyle(el)
19+
if (computedStyle.display === 'inline') el.style.display = 'inline-block'
20+
1721
const {left, top, width, height} = el.getBoundingClientRect()
18-
const isFixed = getComputedStyle(el).position === 'fixed'
22+
const isFixed = computedStyle.position === 'fixed'
1923

2024
this.style.setProperty('--top', `${top + (isFixed ? 0 : window.scrollY)}px`)
2125
this.style.setProperty('--left', `${left}px`)

0 commit comments

Comments
 (0)