From: Dominik Csapak <d.csapak@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
Daniel Tschlatscher <d.tschlatscher@proxmox.com>
Subject: Re: [pve-devel] [PATCH widget-toolkit] fix: gui: up/down arrow keys increment/decrement twice in Number field
Date: Wed, 13 Jul 2022 11:49:49 +0200 [thread overview]
Message-ID: <99097960-883b-a4dc-2d5e-910a438b2e2f@proxmox.com> (raw)
In-Reply-To: <20220707134132.391584-1-d.tschlatscher@proxmox.com>
man, extjs overrides are weird. i was convinced that even
the onRender gets 'overridden' and not simply called from a subclass?
anyway in that case the fix looks ok, but i think we can even go
further. since the original code will evidently be called,
how about we remove the original 'onMouseWheel' handler too?
we'd probably have to do something like:
---8<---
if (me.mouseWheelEnabled) {
me.mun(me.bodyEl, 'mousewheel', me.onMouseWheel, ...)
...
}
--->8---
(untested ofc)
i guess it works currently because the 'mousewheel' event
does not even trigger? (idk though)
also the 'spin{Up/Down}El' part at the end of the function is probably
unnecessary too since the 'callParent' call already takes care of that
On 7/7/22 15:41, Daniel Tschlatscher wrote:
> 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.tschlatscher@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);
prev parent reply other threads:[~2022-07-13 9:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-07 13:41 Daniel Tschlatscher
2022-07-13 9:49 ` Dominik Csapak [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=99097960-883b-a4dc-2d5e-910a438b2e2f@proxmox.com \
--to=d.csapak@proxmox.com \
--cc=d.tschlatscher@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.