[pve-devel] [PATCH manager 1/3] ui: tags: fix focus for edit mode

Dominik Csapak d.csapak at proxmox.com
Thu Oct 19 15:36:05 CEST 2023


such that one can tab through the editable tag fields.
We have to handle that manually, since ExtJs does not expect
contenteditable html tags for focus handling.

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/form/Tag.js | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/www/manager6/form/Tag.js b/www/manager6/form/Tag.js
index be72d7ba..6b1d6aa5 100644
--- a/www/manager6/form/Tag.js
+++ b/www/manager6/form/Tag.js
@@ -13,6 +13,15 @@ Ext.define('Proxmox.form.Tag', {
 	'<i class="action fa fa-minus-square"></i>',
     ],
 
+    focusable: true,
+    getFocusEl: function() {
+	return Ext.get(this.tagEl());
+    },
+
+    onFocus: function() {
+	this.selectText();
+    },
+
     // contains tags not to show in the picker and not allowing to set
     filter: [],
 
-- 
2.30.2






More information about the pve-devel mailing list