Skip to content

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

feature: supporting enter for confirming changes in the dialog

Ilian Sapundshiev213a6f3dc61b
diff --git a/app/components/dialogs/CreateTagGroupDialog.tsx b/app/components/dialogs/CreateTagGroupDialog.tsx
index d71261f6e..72ed6fd06 100644
--- a/app/components/dialogs/CreateTagGroupDialog.tsx
+++ b/app/components/dialogs/CreateTagGroupDialog.tsx
@@ -156,7 +156,11 @@ class CreateTagGroupDialog extends React.Component<Props, State> {
fullScreen={fullScreen}
keepMounted
scroll="paper"
- // onKeyDown={confirmFunction}
+ onKeyDown={event => {
+ if (event.key === 'Enter' || event.keyCode === 13) {
+ this.onConfirm();
+ }
+ }}
>
<DialogTitle>{i18n.t('core:createTagGroupTitle')}</DialogTitle>
<DialogContent>
diff --git a/app/components/dialogs/CreateTagsDialog.tsx b/app/components/dialogs/CreateTagsDialog.tsx
index c7142640a..26ab61f42 100644
--- a/app/components/dialogs/CreateTagsDialog.tsx
+++ b/app/components/dialogs/CreateTagsDialog.tsx
@@ -88,6 +88,11 @@ class CreateTagsDialog extends React.Component<Props, State> {
fullScreen={fullScreen}
keepMounted
scroll="paper"
+ onKeyDown={event => {
+ if (event.key === 'Enter' || event.keyCode === 13) {
+ this.onConfirm();
+ }
+ }}
>
<DialogTitle>{i18n.t('core:addTagsToGroupTitle')}</DialogTitle>
<DialogContent style={{ minWidth: 400 }}>
diff --git a/app/components/dialogs/EditEntryTagDialog.tsx b/app/components/dialogs/EditEntryTagDialog.tsx
index ecef39609..d46003d8e 100644
--- a/app/components/dialogs/EditEntryTagDialog.tsx
+++ b/app/components/dialogs/EditEntryTagDialog.tsx
@@ -182,7 +182,11 @@ const EditEntryTagDialog = (props: Props) => {
open={open}
fullScreen={fullScreen}
onClose={onClose}
- // onEnterKey={(event) => onEnterKeyHandler(event, onConfirm)}
+ onKeyDown={event => {
+ if (event.key === 'Enter' || event.keyCode === 13) {
+ onConfirm();
+ }
+ }}
>
{renderTitle()}
{renderContent()}
diff --git a/app/components/dialogs/EditTagDialog.tsx b/app/components/dialogs/EditTagDialog.tsx
index 39d6c0eae..d0e1dffd7 100644
--- a/app/components/dialogs/EditTagDialog.tsx
+++ b/app/components/dialogs/EditTagDialog.tsx
@@ -171,7 +171,11 @@ class EditTagDialog extends React.Component<Props, State> {
onClose={onClose}
keepMounted
scroll="paper"
- // onEnterKey={(event) => onEnterKeyHandler(event, this.addTags)}
+ onKeyDown={event => {
+ if (event.key === 'Enter' || event.keyCode === 13) {
+ this.onConfirm();
+ }
+ }}
>
<DialogTitle style={{ overflow: 'visible' }}>
{i18n.t('core:editTagTitle')}
diff --git a/app/components/dialogs/EditTagGroupDialog.tsx b/app/components/dialogs/EditTagGroupDialog.tsx
index 619796d9d..d6a335f31 100644
--- a/app/components/dialogs/EditTagGroupDialog.tsx
+++ b/app/components/dialogs/EditTagGroupDialog.tsx
@@ -296,7 +296,11 @@ class EditTagGroupDialog extends React.Component<Props, State> {
open={open}
fullScreen={fullScreen}
onClose={onClose}
- // onEnterKey={(event) => onEnterKeyHandler(event, this.onConfirm)}
+ onKeyDown={event => {
+ if (event.key === 'Enter' || event.keyCode === 13) {
+ this.onConfirm();
+ }
+ }}
>
{this.renderTitle()}
{this.renderContent()}