]> git.proxmox.com Git - pve-manager.git/commitdiff
add override for correct defaultButton behaviour
authorDominik Csapak <d.csapak@proxmox.com>
Fri, 2 Jun 2017 08:55:16 +0000 (10:55 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 2 Jun 2017 14:16:11 +0000 (16:16 +0200)
we disable the defaultButton behaviour on textarea and aria-multiline
fields, else we cannot input a newline into a textarea on a form with
a defaultButton defined

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
www/manager6/Toolkit.js

index 0e578dab0c2f418ea0f49403584b24c75d077610..bb6c26ce56dd2790ffd763df8cdb3f2f03bb719e 100644 (file)
@@ -169,6 +169,20 @@ Ext.define('PVE.UnderlayPool', {
     }
 });
 
+// 'Enter' in Textareas and aria multiline fields should not activate the
+// defaultbutton, fixed in extjs 6.0.2
+Ext.define('PVE.panel.Panel', {
+    override: 'Ext.panel.Panel',
+
+    fireDefaultButton: function(e) {
+       if (e.target.getAttribute('aria-multiline') === 'true' ||
+           e.target.tagName === "TEXTAREA") {
+           return true;
+       }
+       return this.callParent(arguments);
+    }
+});
+
 // if the order of the values are not the same in originalValue and value
 // extjs will not overwrite value, but marks the field dirty and thus
 // the reset button will be enabled (but clicking it changes nothing)