Skip to content

Commit 829faf2

Browse files
authored
Merge pull request #46 from github/fix-top-layer-positioning-absolute-to-window
fix top-layer positioning absolute
2 parents ad227be + cfdfbfa commit 829faf2

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)