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

View File

@@ -80,7 +80,10 @@ export const ModalProvider = ({ children }: PropsWithChildren) => {
return ( return (
<ModalContext.Provider value={{ openModalInner, closeModal }}> <ModalContext.Provider value={{ openModalInner, closeModal }}>
{activeModals.map((modal) => ( {activeModals.map((modal) => {
const { defaultTitle: _ignored, ...otherModalProps } =
modal.reference.modalProps;
return (
<Modal <Modal
key={modal.id} key={modal.id}
zIndex={getDefaultZIndex("modal") + 1} zIndex={getDefaultZIndex("modal") + 1}
@@ -95,14 +98,15 @@ export const ModalProvider = ({ children }: PropsWithChildren) => {
}, },
}} }}
trapFocus={modal.id === state.current?.id} trapFocus={modal.id === state.current?.id}
{...modal.reference.modalProps} {...otherModalProps}
title={translateIfNecessary(t, modal.props.defaultTitle)} title={translateIfNecessary(t, modal.props.defaultTitle)}
opened={state.modals.length > 0} opened={state.modals.length > 0}
onClose={handleCloseModal} onClose={handleCloseModal}
> >
{modal.reference.content} {modal.reference.content}
</Modal> </Modal>
))} );
})}
{children} {children}
</ModalContext.Provider> </ModalContext.Provider>