diff --git a/app/components/Popover.tsx b/app/components/Popover.tsx index 0f639bf10..d02e4cc2a 100644 --- a/app/components/Popover.tsx +++ b/app/components/Popover.tsx @@ -6,7 +6,6 @@ import breakpoint from "styled-components-breakpoint"; import { depths, s } from "@shared/styles"; import useKeyDown from "~/hooks/useKeyDown"; import useMobile from "~/hooks/useMobile"; -import useOnClickOutside from "~/hooks/useOnClickOutside"; import { fadeAndScaleIn } from "~/styles/animations"; type Props = PopoverProps & { @@ -30,7 +29,6 @@ const Popover: React.FC = ({ mobilePosition, ...rest }: Props) => { - const contentRef = React.useRef(null); const isMobile = useMobile(); // Custom Escape handler rather than using hideOnEsc from reakit so we can @@ -48,16 +46,6 @@ const Popover: React.FC = ({ } ); - // Custom click outside handling rather than using `hideOnClickOutside` from reakit so that we can - // respect event.defaultPrevented. - useOnClickOutside(contentRef, (event) => { - if (rest.visible && !event.defaultPrevented) { - event.stopPropagation(); - event.preventDefault(); - rest.hide(); - } - }); - if (isMobile) { return ( @@ -74,9 +62,8 @@ const Popover: React.FC = ({ } return ( - +