pressing 'Enter' accepts the current tags and
'Escape' cancels editing

Signed-off-by: Dominik Csapak <d.csa...@proxmox.com>
---
 www/manager6/form/Tag.js     | 3 ++-
 www/manager6/form/TagEdit.js | 7 +++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/www/manager6/form/Tag.js b/www/manager6/form/Tag.js
index 8d003ca97..6fda2e848 100644
--- a/www/manager6/form/Tag.js
+++ b/www/manager6/form/Tag.js
@@ -104,10 +104,11 @@ Ext.define('Proxmox.form.Tag', {
        let key = event.browserEvent.key;
        switch (key) {
            case 'Enter':
+           case 'Escape':
+               me.fireEvent('keypress', key);
                break;
            case 'ArrowLeft':
            case 'ArrowRight':
-           case 'Escape':
            case 'Backspace':
            case 'Delete':
                return;
diff --git a/www/manager6/form/TagEdit.js b/www/manager6/form/TagEdit.js
index 23b75acc7..18d8927d7 100644
--- a/www/manager6/form/TagEdit.js
+++ b/www/manager6/form/TagEdit.js
@@ -214,6 +214,13 @@ Ext.define('PVE.panel.TagEditContainer', {
                    destroy: function() {
                        vm.set('tagCount', vm.get('tagCount') - 1);
                    },
+                   keypress: function(key) {
+                       if (key === 'Enter') {
+                           me.editClick();
+                       } else if (key === 'Escape') {
+                           me.cancelClick();
+                       }
+                   },
                },
            });
 
-- 
2.30.2



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to