mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-22 19:25:18 -04:00
Add condition to modal
This way we prevent unwanted data loading, invisible updates and visual artifacts when the modal isn't visible. Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
89eac12a38
commit
9500887ee6
1 changed files with 20 additions and 18 deletions
|
@ -48,6 +48,7 @@ export const CommonModal: React.FC<CommonModalProps> = ({
|
||||||
}, [title, titleIsI18nKey])
|
}, [title, titleIsI18nKey])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<ShowIf condition={show}>
|
||||||
<Modal
|
<Modal
|
||||||
{...cypressId(props)}
|
{...cypressId(props)}
|
||||||
show={show}
|
show={show}
|
||||||
|
@ -66,5 +67,6 @@ export const CommonModal: React.FC<CommonModalProps> = ({
|
||||||
</Modal.Header>
|
</Modal.Header>
|
||||||
{children}
|
{children}
|
||||||
</Modal>
|
</Modal>
|
||||||
|
</ShowIf>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue