Skip to content

Commit 007c238

Browse files
committed
Use documentElement.clientWidth/clientHeight instead of innerWidth/innerHeight
1 parent 032c8e3 commit 007c238

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/tooltip.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,8 @@ class CompletionTooltip {
220220
let selRect = sel.getBoundingClientRect()
221221
let space = this.space
222222
if (!space) {
223-
let win = this.dom.ownerDocument.defaultView || window
224-
space = {left: 0, top: 0, right: win.innerWidth, bottom: win.innerHeight}
223+
let docElt = this.dom.ownerDocument.documentElement
224+
space = {left: 0, top: 0, right: docElt.clientWidth, bottom: docElt.clientHeight}
225225
}
226226
if (selRect.top > Math.min(space.bottom, listRect.bottom) - 10 ||
227227
selRect.bottom < Math.max(space.top, listRect.top) + 10)

0 commit comments

Comments
 (0)