Skip to content

TagSpaces is an offline, open source, document manager with tagging support

preventing closing of the license dialog by click on the backdrop

Ilian Sapundshievc969638f513c
diff --git a/app/components/dialogs/GenericDialog.js b/app/components/dialogs/GenericDialog.js
index a2b4022e2..aca6a6af0 100644
--- a/app/components/dialogs/GenericDialog.js
+++ b/app/components/dialogs/GenericDialog.js
@@ -35,10 +35,11 @@ type Props = {
open?: boolean,
fullScreen?: boolean,
onClose: () => void,
+ onBackdropClick?: () => void,
onEnterKey?: () => void,
- renderTitle: () => Object,
+ renderTitle?: () => Object,
renderContent: () => Object,
- renderActions: () => Object
+ renderActions?: () => Object
};
export function onEnterKeyHandler(event: any, confirmFunction: () => void) {
@@ -78,6 +79,8 @@ const GenericDialog = (props: Props) => {
fullScreen,
open,
onEnterKey,
+ onClose,
+ onBackdropClick
} = props;
return (
<Dialog
@@ -85,7 +88,9 @@ const GenericDialog = (props: Props) => {
open={open}
TransitionComponent={Transition}
keepMounted
- onClose={props.onClose}
+ onClose={onClose}
+ onBackdropClick={onBackdropClick && onClose}
+ // onEscapeKeyDown={onClose}
onKeyDown={onEnterKey || ((event) => onEnterKeyHandler(event, props.onClose))}
>
{props.renderTitle && props.renderTitle()}
diff --git a/app/components/dialogs/LicenseDialog.js b/app/components/dialogs/LicenseDialog.js
index b87b53d35..06474f5ee 100644
--- a/app/components/dialogs/LicenseDialog.js
+++ b/app/components/dialogs/LicenseDialog.js
@@ -107,6 +107,7 @@ const LicenseDialog = (props: Props) => {
<GenericDialog
open={open}
onClose={onClose}
+ onBackdropClick={() => {}}
fullScreen={fullScreen}
renderTitle={renderTitle}
renderContent={renderContent}