File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
src/components/DsfrTooltip Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,9 @@ async function computePosition () {
2626 if (typeof document === ' undefined' ) {
2727 return
2828 }
29+ if (typeof window === ' undefined' ) {
30+ return
31+ }
2932 if (! show .value ) {
3033 return
3134 }
@@ -40,7 +43,7 @@ async function computePosition () {
4043 const tooltipTop = tooltip .value ?.offsetTop as number
4144 const tooltipLeft = tooltip .value ?.offsetLeft as number
4245
43- const isTooltipAtBottom = sourceTop + sourceHeight + tooltipHeight >= document . documentElement . offsetHeight
46+ const isTooltipAtBottom = sourceTop + sourceHeight + tooltipHeight >= window . innerHeight
4447 top .value = isTooltipAtBottom
4548
4649 const isTooltipOnRightSide = (sourceLeft + (sourceWidth / 2 ) + (tooltipWidth / 2 )) >= document .documentElement .offsetWidth
You can’t perform that action at this time.
0 commit comments