From 04a9f197e85009aa302f63a1c73a2a5dc0decad5 Mon Sep 17 00:00:00 2001 From: Sirttas Date: Mon, 20 Jul 2026 10:04:10 +0200 Subject: [PATCH] fix(#2): Tooltip popup is clipped/hidden behind table content --- src/components/tooltip/Tooltip.vue | 49 ++++++++++++------- .../AcquisitionQuartilesTooltip.vue | 5 +- 2 files changed, 32 insertions(+), 22 deletions(-) diff --git a/src/components/tooltip/Tooltip.vue b/src/components/tooltip/Tooltip.vue index ba8d323..b38d0f4 100644 --- a/src/components/tooltip/Tooltip.vue +++ b/src/components/tooltip/Tooltip.vue @@ -8,20 +8,27 @@ const open = defineModel('open', { default: false }); const { width, height } = useSharedWindowSize(); const mainDiv = ref(null); -const { top, left } = useElementBounding(mainDiv); +const { top, bottom, left, right } = useElementBounding(mainDiv); -const positions = computed(() => { - if (top.value < height.value / 2) { - if (left.value < width.value / 2) { - return ['top', 'left']; - } - return ['top', 'right']; +const positions = computed(() => [ + top.value < height.value / 2 ? 'top' : 'bottom', + left.value < width.value / 2 ? 'left' : 'right', +]); + +const floatingStyle = computed(() => { + const style: Record = {}; + if (positions.value.includes('top')) { + style.top = `${bottom.value}px`; + } else { + style.bottom = `${height.value - top.value}px`; } - if (left.value < width.value / 2) { - return ['bottom', 'left']; + if (positions.value.includes('left')) { + style.left = `${left.value}px`; + } else { + style.right = `${width.value - right.value}px`; } - return ['bottom', 'right']; -}) + return style; +}); \ No newline at end of file + + + diff --git a/src/market/acquisition/AcquisitionQuartilesTooltip.vue b/src/market/acquisition/AcquisitionQuartilesTooltip.vue index 537d5cd..241dd4b 100644 --- a/src/market/acquisition/AcquisitionQuartilesTooltip.vue +++ b/src/market/acquisition/AcquisitionQuartilesTooltip.vue @@ -43,7 +43,7 @@ const lineColor = computed(() => {