Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
refactor(react/dialogs): don't render modals unless they are actually shown
Elian Doran48eebbe2fee0
diff --git a/apps/client/src/widgets/react/Modal.tsx b/apps/client/src/widgets/react/Modal.tsxindex 221236e8ee..84f20a9b44 100644--- a/apps/client/src/widgets/react/Modal.tsx+++ b/apps/client/src/widgets/react/Modal.tsx@@ -116,7 +116,7 @@ export default function Modal({ children, className, size, title, header, footerreturn (<div className={`modal fade mx-auto ${className}`} tabIndex={-1} style={dialogStyle} role="dialog" ref={modalRef}>- <div className={`modal-dialog modal-${size} ${scrollable ? "modal-dialog-scrollable" : ""}`} style={documentStyle} role="document">+ {show && <div className={`modal-dialog modal-${size} ${scrollable ? "modal-dialog-scrollable" : ""}`} style={documentStyle} role="document"><div className="modal-content"><div className="modal-header">{!title || typeof title === "string" ? (@@ -144,7 +144,7 @@ export default function Modal({ children, className, size, title, header, footer</ModalInner>)}</div>- </div>+ </div>}</div>);}