From 8be3f91d8e15ccd2ec2d867b46c603c5688ee5e8 Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Tue, 26 Jul 2022 21:55:38 +0400 Subject: [PATCH] improve tooltip positioning --- packages/components/src/components/ui/Tooltip.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/components/src/components/ui/Tooltip.tsx b/packages/components/src/components/ui/Tooltip.tsx index 7940d5fb..4eefa448 100644 --- a/packages/components/src/components/ui/Tooltip.tsx +++ b/packages/components/src/components/ui/Tooltip.tsx @@ -1,6 +1,7 @@ import React, { cloneElement, useState } from "react"; import { AnimatePresence, motion } from "framer-motion"; import { + flip, shift, useDismiss, useFloating, @@ -21,7 +22,7 @@ export const Tooltip: React.FC = ({ text, children }) => { placement: "top", open: isOpen, onOpenChange: setIsOpen, - middleware: [shift()], + middleware: [shift(), flip()], }); const { getReferenceProps, getFloatingProps } = useInteractions([