File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -103,9 +103,10 @@ export function tooltips(config: {
103103 parent ?: HTMLElement
104104 /// By default, when figuring out whether there is room for a
105105 /// tooltip at a given position, the extension considers the entire
106- /// space between 0,0 and `innerWidth`,`innerHeight` to be available
107- /// for showing tooltips. You can provide a function here that
108- /// returns an alternative rectangle.
106+ /// space between 0,0 and
107+ /// `documentElement.clientWidth`/`clientHeight` to be available for
108+ /// showing tooltips. You can provide a function here that returns
109+ /// an alternative rectangle.
109110 tooltipSpace ?: ( view : EditorView ) => Rect
110111} = { } ) : Extension {
111112 return tooltipConfig . of ( config )
@@ -118,8 +119,8 @@ type TooltipConfig = {
118119}
119120
120121function windowSpace ( view : EditorView ) {
121- let { win } = view
122- return { top : 0 , left : 0 , bottom : win . innerHeight , right : win . innerWidth }
122+ let docElt = view . dom . ownerDocument . documentElement
123+ return { top : 0 , left : 0 , bottom : docElt . clientHeight , right : docElt . clientWidth }
123124}
124125
125126const tooltipConfig = Facet . define < Partial < TooltipConfig > , TooltipConfig > ( {
You can’t perform that action at this time.
0 commit comments