Skip to content

EspoCRM – Open Source CRM Application

Control+Enter textarea support

Yuriice1bb9bc4bed
diff --git a/client/src/views/admin/layouts/modals/panel-attributes.js b/client/src/views/admin/layouts/modals/panel-attributes.js
index 5c61fd4691..4e5f7e4586 100644
--- a/client/src/views/admin/layouts/modals/panel-attributes.js
+++ b/client/src/views/admin/layouts/modals/panel-attributes.js
@@ -44,7 +44,10 @@ export default class LayoutPanelAttributesView extends ModalView {
shortcutKeys = {
/** @this LayoutPanelAttributesView */
'Control+Enter': function (e) {
- if (document.activeElement instanceof HTMLInputElement) {
+ if (
+ document.activeElement instanceof HTMLInputElement ||
+ document.activeElement instanceof HTMLTextAreaElement
+ ) {
document.activeElement.dispatchEvent(new Event('change', {bubbles: true}));
}
diff --git a/client/src/views/admin/link-manager/modals/edit.js b/client/src/views/admin/link-manager/modals/edit.js
index b059f658e2..82b98c63b8 100644
--- a/client/src/views/admin/link-manager/modals/edit.js
+++ b/client/src/views/admin/link-manager/modals/edit.js
@@ -49,7 +49,10 @@ class LinkManagerEditModalView extends ModalView {
},
/** @this LinkManagerEditModalView */
'Control+Enter': function (e) {
- if (document.activeElement instanceof HTMLInputElement) {
+ if (
+ document.activeElement instanceof HTMLInputElement ||
+ document.activeElement instanceof HTMLTextAreaElement
+ ) {
document.activeElement.dispatchEvent(new Event('change', {bubbles: true}));
}
diff --git a/client/src/views/dashlets/options/base.js b/client/src/views/dashlets/options/base.js
index faecac82c9..9c3bd5642e 100644
--- a/client/src/views/dashlets/options/base.js
+++ b/client/src/views/dashlets/options/base.js
@@ -261,7 +261,10 @@ class BaseDashletOptionsModalView extends ModalView {
e.preventDefault();
e.stopPropagation();
- if (document.activeElement instanceof HTMLInputElement) {
+ if (
+ document.activeElement instanceof HTMLInputElement ||
+ document.activeElement instanceof HTMLTextAreaElement
+ ) {
document.activeElement.dispatchEvent(new Event('change', {bubbles: true}));
}
diff --git a/client/src/views/fields/base.ts b/client/src/views/fields/base.ts
index 38141e5a07..08474be3b2 100644
--- a/client/src/views/fields/base.ts
+++ b/client/src/views/fields/base.ts
@@ -1421,7 +1421,10 @@ export default class BaseFieldView<
if (key === 'Control+Enter') {
e.stopPropagation();
- if (document.activeElement instanceof HTMLInputElement) {
+ if (
+ document.activeElement instanceof HTMLInputElement ||
+ document.activeElement instanceof HTMLTextAreaElement
+ ) {
// Fields may need to fetch data first.
document.activeElement.dispatchEvent(new Event('change', {bubbles: true}));
}
diff --git a/client/src/views/modals/edit.js b/client/src/views/modals/edit.js
index 5349f1a45b..123280d8a5 100644
--- a/client/src/views/modals/edit.js
+++ b/client/src/views/modals/edit.js
@@ -82,7 +82,10 @@ class EditModalView extends ModalView {
e.preventDefault();
e.stopPropagation();
- if (document.activeElement instanceof HTMLInputElement) {
+ if (
+ document.activeElement instanceof HTMLInputElement ||
+ document.activeElement instanceof HTMLTextAreaElement
+ ) {
// Fields may need to fetch data first.
document.activeElement.dispatchEvent(new Event('change', {bubbles: true}));
}
diff --git a/client/src/views/record/detail.ts b/client/src/views/record/detail.ts
index 316db56917..c997809077 100644
--- a/client/src/views/record/detail.ts
+++ b/client/src/views/record/detail.ts
@@ -3635,7 +3635,10 @@ class DetailRecordView<S extends DetailRecordViewSchema = DetailRecordViewSchema
event.preventDefault();
event.stopPropagation();
- if (document.activeElement instanceof HTMLInputElement) {
+ if (
+ document.activeElement instanceof HTMLInputElement ||
+ document.activeElement instanceof HTMLTextAreaElement
+ ) {
// Fields may need to fetch data first.
document.activeElement.dispatchEvent(new Event('change', {bubbles: true}));
}