Skip to content

Commit

Permalink
fix top-layer positioning absolute to window
Browse files Browse the repository at this point in the history
  • Loading branch information
keithamus committed Nov 14, 2023
1 parent d215a84 commit cfdfbfa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/text-expander-element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ class TextExpander {
const rect = this.input.getBoundingClientRect()
top += rect.top
left += rect.left
if (getComputedStyle(menu).position === 'absolute') {
top += window.scrollY
left += window.scrollX
}
}
menu.style.top = `${top}px`
menu.style.left = `${left}px`
Expand Down

0 comments on commit cfdfbfa

Please sign in to comment.