Skip to content

Commit cfdfbfa

Browse files
committed
fix top-layer positioning absolute to window
1 parent d215a84 commit cfdfbfa

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/text-expander-element.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ class TextExpander {
108108
const rect = this.input.getBoundingClientRect()
109109
top += rect.top
110110
left += rect.left
111+
if (getComputedStyle(menu).position === 'absolute') {
112+
top += window.scrollY
113+
left += window.scrollX
114+
}
111115
}
112116
menu.style.top = `${top}px`
113117
menu.style.left = `${left}px`

0 commit comments

Comments
 (0)