mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-25 19:26:31 -05: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])
|
||||
|
||||
return (
|
||||
<ShowIf condition={show}>
|
||||
<Modal
|
||||
{...cypressId(props)}
|
||||
show={show}
|
||||
|
@ -66,5 +67,6 @@ export const CommonModal: React.FC<CommonModalProps> = ({
|
|||
</Modal.Header>
|
||||
{children}
|
||||
</Modal>
|
||||
</ShowIf>
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue