Skip to content

Commit

Permalink
fix: add flip fallback axis for tooltips (#458)
Browse files Browse the repository at this point in the history
  • Loading branch information
therobertmaftei authored Feb 15, 2024
1 parent f663cdb commit 7e47cf1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/src/components/cat-tooltip/cat-tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand Down

0 comments on commit 7e47cf1

Please sign in to comment.