EspoCRM – Open Source CRM Application
PHP calendarcontactscrmcrm-platformcrm-systemcustomer-portalcustomer-supportcustomizabledocumentsemail-marketingkanbanleadsopen-sourcephpplatformsales-automationsingle-page-applicationsupport
text field: prevent unwanted scroll on enter
Yuri Kuznetsov44b9f604787c
diff --git a/client/src/views/fields/text.js b/client/src/views/fields/text.jsindex 85d6bc0eb4..ed8075c0ed 100644--- a/client/src/views/fields/text.js+++ b/client/src/views/fields/text.js@@ -633,6 +633,12 @@ class TextFieldView extends BaseFieldView {const match = before.match(/(^|\n)( *[-*]|\d+\.)([^\n]*)$/);if (!match) {+ // Prevent unwanted scroll applied by the browser on enter.+ event.preventDefault();++ target.value = before + "\n" + after;+ target.selectionStart = target.selectionEnd = before.length + 1;+return;}