improve tooltip positioning
This commit is contained in:
parent
2abb3968dd
commit
8be3f91d8e
|
@ -1,6 +1,7 @@
|
||||||
import React, { cloneElement, useState } from "react";
|
import React, { cloneElement, useState } from "react";
|
||||||
import { AnimatePresence, motion } from "framer-motion";
|
import { AnimatePresence, motion } from "framer-motion";
|
||||||
import {
|
import {
|
||||||
|
flip,
|
||||||
shift,
|
shift,
|
||||||
useDismiss,
|
useDismiss,
|
||||||
useFloating,
|
useFloating,
|
||||||
|
@ -21,7 +22,7 @@ export const Tooltip: React.FC<Props> = ({ text, children }) => {
|
||||||
placement: "top",
|
placement: "top",
|
||||||
open: isOpen,
|
open: isOpen,
|
||||||
onOpenChange: setIsOpen,
|
onOpenChange: setIsOpen,
|
||||||
middleware: [shift()],
|
middleware: [shift(), flip()],
|
||||||
});
|
});
|
||||||
|
|
||||||
const { getReferenceProps, getFloatingProps } = useInteractions([
|
const { getReferenceProps, getFloatingProps } = useInteractions([
|
||||||
|
|
Loading…
Reference in New Issue
Block a user