[pve-devel] [PATCH proxmox-widget-toolkit] fix Firefox spinner scroller

Thomas Lamprecht t.lamprecht at proxmox.com
Sat Jan 11 16:06:27 CET 2020


Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---

Especially since I recently got a MX Master 3 mouse with the best scroll wheel
ever™, the broken increase/decrease in numberfields with spinners in Firefox
irked me more than ever. As a new ExtJS, which would had this fixed, seems not
like an option happening anytime soon I finally got to a workaround.
It seems hacky, but effectively it just preserves the casing for the
'DOMMouseScroll' event, like it'd be done for vendor specific events.
As other browsers seem to be OK without that keep them that way, to reduce
regression possibilty as much as possible.
I tested all scroll bars I could immagine in 3 minutes, please holler if
something still broke.

 Toolkit.js | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Toolkit.js b/Toolkit.js
index 6956a8e..538db3a 100644
--- a/Toolkit.js
+++ b/Toolkit.js
@@ -3,6 +3,11 @@
  // do not send '_dc' parameter
 Ext.Ajax.disableCaching = false;
 
+// FIXME: HACK! Makes scrolling in number spinner work again. fixed in ExtJS >= 6.1
+if (Ext.isFirefox) {
+    Ext.$eventNameMap.DOMMouseScroll = 'DOMMouseScroll';
+}
+
 // custom Vtypes
 Ext.apply(Ext.form.field.VTypes, {
     IPAddress:  function(v) {
-- 
2.20.1





More information about the pve-devel mailing list