[pve-devel] [PATCH manager 1/3] add override for correct defaultButton behaviour

Dominik Csapak d.csapak at proxmox.com
Fri Jun 2 10:55:16 CEST 2017


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 at proxmox.com>
---
 www/manager6/Toolkit.js | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/www/manager6/Toolkit.js b/www/manager6/Toolkit.js
index 0e578dab..bb6c26ce 100644
--- a/www/manager6/Toolkit.js
+++ b/www/manager6/Toolkit.js
@@ -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)
-- 
2.11.0





More information about the pve-devel mailing list