From 57bba04cf3438030bc52fe154021baf2f6286877 Mon Sep 17 00:00:00 2001 From: lebaudantoine Date: Fri, 30 Aug 2024 15:24:11 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8(frontend)=20pass=20ref=20to=20the=20d?= =?UTF-8?q?ialog=20inner=20overlay?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Needed a ref to determine the size of the opened overlay. --- src/frontend/src/primitives/Dialog.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/frontend/src/primitives/Dialog.tsx b/src/frontend/src/primitives/Dialog.tsx index de53fe02..0e1f5372 100644 --- a/src/frontend/src/primitives/Dialog.tsx +++ b/src/frontend/src/primitives/Dialog.tsx @@ -10,6 +10,7 @@ import { } from 'react-aria-components' import { Div, Button, Box, VerticallyOffCenter } from '@/primitives' import { text } from './Text' +import { MutableRefObject } from 'react' const StyledModalOverlay = styled(ModalOverlay, { base: { @@ -61,6 +62,7 @@ export type DialogProps = RACDialogProps & { */ onOpenChange?: (isOpen: boolean) => void type?: 'flex' + innerRef?: MutableRefObject } export const Dialog = ({ @@ -69,6 +71,7 @@ export const Dialog = ({ onClose, isOpen, onOpenChange, + innerRef, ...dialogProps }: DialogProps) => { const isAlert = dialogProps['role'] === 'alertdialog' @@ -93,7 +96,7 @@ export const Dialog = ({
- + {!!title && (