feat: add useSetOverflowVisibleOnRA hook

This commit is contained in:
Arvid Norlin
2024-11-15 15:14:00 +01:00
committed by Christel Westerberg
parent 1004871afb
commit e18a2fdc44
5 changed files with 5 additions and 58 deletions

View File

@@ -1,4 +1,3 @@
import { useRef } from "react"
import {
Button,
Dialog,
@@ -8,6 +7,7 @@ import {
} from "react-aria-components"
import { CloseLargeIcon } from "@/components/Icons"
import useSetOverFlowVisibleOnRA from "@/hooks/useSetOverflowVisibleOnRA"
import { Arrow } from "./Arrow"
import { PopoverProps } from "./popover"
@@ -19,10 +19,10 @@ export default function Popover({
children,
...props
}: PopoverProps) {
let triggerRef = useRef(null)
const setOverflowVisible = useSetOverFlowVisibleOnRA()
return (
<DialogTrigger>
<DialogTrigger onOpenChange={setOverflowVisible}>
<Button className={styles.trigger}>{triggerContent}</Button>
<RAPopover