Skip to content

Commit

Permalink
fixup! chore(ErrorFormTooltip): migrate from react-popper to floating-ui
Browse files Browse the repository at this point in the history
  • Loading branch information
DSil committed Oct 17, 2024
1 parent 40288a6 commit 119645d
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const ErrorFormTooltip = ({
const contentRef = React.useRef<HTMLDivElement | null>(null);
const { isDesktop } = useMediaQuery();

const { refs, floatingStyles, placement } = useFloating({
const { refs, floatingStyles } = useFloating({
placement: "top-start",
whileElementsMounted: autoUpdate,
onOpenChange: onShown,
Expand Down Expand Up @@ -62,8 +62,6 @@ const ErrorFormTooltip = ({
};
}, [onShown, isHelp, helpClosable, refs.floating]);

const isVertical = placement === "top-start" || placement === "top-end" ? "bottom" : "top";

const cssVars = {
"--error-form-tooltip-position": floatingStyles.position,
"--error-form-tooltip-top": floatingStyles.top,
Expand Down Expand Up @@ -94,8 +92,7 @@ const ErrorFormTooltip = ({
>
<div
className={cx(
"start-200 absolute rtl:start-0",
isVertical ? "bottom-50" : "top-50",
"start-200 bottom-50 absolute rtl:start-0",
inlineLabel && "rtl:start-0",
isHelp ? "before:bg-blue-normal" : "before:bg-red-normal",
"before:size-200 before:absolute before:-translate-x-1/2 before:-translate-y-1/2 before:rotate-45",
Expand Down

0 comments on commit 119645d

Please sign in to comment.