Skip to content

Commit

Permalink
Merge pull request #46 from github/fix-top-layer-positioning-absolute…
Browse files Browse the repository at this point in the history
…-to-window

fix top-layer positioning absolute
  • Loading branch information
keithamus authored Nov 14, 2023
2 parents ad227be + cfdfbfa commit 829faf2
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 829faf2

Please sign in to comment.