]> git.proxmox.com Git - proxmox-widget-toolkit.git/commitdiff
Toolkit: add override for Ext.dd.DragDropManager
authorDominik Csapak <d.csapak@proxmox.com>
Tue, 15 Nov 2022 13:02:35 +0000 (14:02 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 16 Nov 2022 13:48:44 +0000 (14:48 +0100)
to fix selection behavior for Ext.dd.DragZone.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
src/Toolkit.js

index 4381f46c88c6793592170c9e704db8dc5ea3c442..2f4a01ab8edd2fda5340256d8dae33f128b3c341 100644 (file)
@@ -686,6 +686,22 @@ Ext.define('Proxmox.view.DragZone', {
     },
 });
 
+// Fix text selection on drag when using DragZone,
+// see https://forum.sencha.com/forum/showthread.php?335100
+Ext.define('Proxmox.dd.DragDropManager', {
+    override: 'Ext.dd.DragDropManager',
+
+    stopEvent: function(e) {
+       if (this.stopPropagation) {
+           e.stopPropagation();
+       }
+
+       if (this.preventDefault) {
+           e.preventDefault();
+       }
+    },
+});
+
 // force alert boxes to be rendered with an Error Icon
 // since Ext.Msg is an object and not a prototype, we need to override it
 // after the framework has been initiated