fix: defaultTitle invalid attribute on div (#350)

This commit is contained in:
Meier Lukas
2024-04-20 12:52:02 +02:00
committed by GitHub
parent 9615568ff3
commit 4970c3a1b2
+7 -3
View File
@@ -80,7 +80,10 @@ export const ModalProvider = ({ children }: PropsWithChildren) => {
return (
<ModalContext.Provider value={{ openModalInner, closeModal }}>
{activeModals.map((modal) => (
{activeModals.map((modal) => {
const { defaultTitle: _ignored, ...otherModalProps } =
modal.reference.modalProps;
return (
<Modal
key={modal.id}
zIndex={getDefaultZIndex("modal") + 1}
@@ -95,14 +98,15 @@ export const ModalProvider = ({ children }: PropsWithChildren) => {
},
}}
trapFocus={modal.id === state.current?.id}
{...modal.reference.modalProps}
{...otherModalProps}
title={translateIfNecessary(t, modal.props.defaultTitle)}
opened={state.modals.length > 0}
onClose={handleCloseModal}
>
{modal.reference.content}
</Modal>
))}
);
})}
{children}
</ModalContext.Provider>