When the up or down arrow key on the keyboard was pressed while a
number text field (or any one descending from Ext.form.field.Spinner)
was selected, the up and down callbacks for that text fields KeyNav
were called twice. Therefore, the value in the text field would always
incorrectly increment/decrement by step * 2.

The problem was an overwrite for the onRender() method of the Spinner
class, which caused the callbacks for pressing an arrow key to be
registered for a second time. Simply not doing that in the overwritten
onRender() method fixes the problem.

Signed-off-by: Daniel Tschlatscher <d.tschlatsc...@proxmox.com>
---
 src/Toolkit.js | 15 ---------------
 1 file changed, 15 deletions(-)

diff --git a/src/Toolkit.js b/src/Toolkit.js
index a1d291e..0ce5185 100644
--- a/src/Toolkit.js
+++ b/src/Toolkit.js
@@ -469,21 +469,6 @@ Ext.define('Proxmox.form.field.Spinner', {
 
        me.callParent();
 
-       // Init up/down arrow keys
-       if (me.keyNavEnabled) {
-           me.spinnerKeyNav = new Ext.util.KeyNav({
-               target: me.inputEl,
-               scope: me,
-               up: me.spinUp,
-               down: me.spinDown,
-           });
-
-           me.inputEl.on({
-               keyup: me.onInputElKeyUp,
-               scope: me,
-           });
-       }
-
        // Init mouse wheel
        if (me.mouseWheelEnabled) {
            me.mon(me.bodyEl, 'wheel', me.onMouseWheel, me);
-- 
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