diff --git a/client/src/components/ui/ActionsPopover.tsx b/client/src/components/ui/ActionsPopover.tsx index f7d040e..d9635f4 100644 --- a/client/src/components/ui/ActionsPopover.tsx +++ b/client/src/components/ui/ActionsPopover.tsx @@ -1,4 +1,4 @@ -import { useState, useRef } from "react"; +import { useState, useRef, useEffect } from "react"; import Button from "./Button"; import MoreIcon from "../icons/MoreIcon"; import PopoverWrapper from "./PopoverWrapper"; @@ -27,6 +27,14 @@ export default function ActionsPopover({ const ref = useClickAway(() => setOpened(false)); + useEffect(() => { + const handleScroll = () => setOpened(false); + + addEventListener("scroll", handleScroll, true); + + return () => removeEventListener("scroll", handleScroll, true); + }, []); + return (