Skip to content

Commit 1c4d0ca

Browse files
committed
fix: 🐛 Correction du chevauchement de l'infobulle sur le côté inférieur
1 parent 77225e7 commit 1c4d0ca

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/components/DsfrTooltip/DsfrTooltip.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)