From 7e47cf18c0dc07b8bb032598de2511cb67d40ba4 Mon Sep 17 00:00:00 2001 From: Robert-Constantin Maftei Date: Thu, 15 Feb 2024 17:54:54 +0200 Subject: [PATCH] fix: add flip fallback axis for tooltips (#458) --- core/src/components/cat-tooltip/cat-tooltip.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/components/cat-tooltip/cat-tooltip.tsx b/core/src/components/cat-tooltip/cat-tooltip.tsx index f5fe01aa..9fb95af9 100644 --- a/core/src/components/cat-tooltip/cat-tooltip.tsx +++ b/core/src/components/cat-tooltip/cat-tooltip.tsx @@ -152,7 +152,11 @@ export class CatTooltip { await computePosition(this.trigger, this.tooltip, { strategy: 'fixed', placement: this.placement, - middleware: [offset(CatTooltip.OFFSET), flip(), shift({ padding: CatTooltip.SHIFT_PADDING })] + middleware: [ + offset(CatTooltip.OFFSET), + flip({ fallbackAxisSideDirection: 'start' }), + shift({ padding: CatTooltip.SHIFT_PADDING }) + ] }).then(({ x, y }) => { if (this.tooltip) { Object.assign(this.tooltip.style, {