This is an automated email from the ASF dual-hosted git repository. hansva pushed a commit to branch 2.18.1-patch in repository https://gitbox.apache.org/repos/asf/hop.git
commit 2551d574645cb0b4a3c74ba6c4384108b41f7071 Author: Hans Van Akelyen <[email protected]> AuthorDate: Mon Jun 8 09:33:09 2026 +0200 fix drag for Hop Web, fixes #7227 (#7241) --- .../hop/ui/hopgui/file/pipeline/HopGuiPipelineGraph.java | 16 ++++++++++++++++ .../hop/ui/hopgui/file/workflow/HopGuiWorkflowGraph.java | 13 +++++++++++++ 2 files changed, 29 insertions(+) diff --git a/ui/src/main/java/org/apache/hop/ui/hopgui/file/pipeline/HopGuiPipelineGraph.java b/ui/src/main/java/org/apache/hop/ui/hopgui/file/pipeline/HopGuiPipelineGraph.java index 938769788e..c285cc34f4 100644 --- a/ui/src/main/java/org/apache/hop/ui/hopgui/file/pipeline/HopGuiPipelineGraph.java +++ b/ui/src/main/java/org/apache/hop/ui/hopgui/file/pipeline/HopGuiPipelineGraph.java @@ -810,6 +810,22 @@ public class HopGuiPipelineGraph extends HopGuiAbstractGraph Point p = currentTransform.getLocation(); iconOffset = new Point(real.x - p.x, real.y - p.y); + + // The RAP/web client does not deliver mouse-move events while a button is held, so the + // movement threshold in mouseMove() can never fire during a press. Arm the drag right + // away on mouse-down so the transform follows the cursor and is dropped on mouse-up; + // native SWT keeps the threshold behaviour to distinguish a click from a drag. + if (EnvironmentUtils.getInstance().isWeb() && event.button == 1 && !shift && !control) { + iconDragCommitted = true; + dragSelection = true; + canvas.setData("mode", "drag"); + selectedTransforms = pipelineMeta.getSelectedTransforms(); + selectedTransform = currentTransform; + pipelineGridDelegate.onPipelineSelectionChanged(); + for (ITransformSelectionListener listener : currentTransformListeners) { + listener.onUpdateSelection(currentTransform); + } + } } redraw(); done = true; diff --git a/ui/src/main/java/org/apache/hop/ui/hopgui/file/workflow/HopGuiWorkflowGraph.java b/ui/src/main/java/org/apache/hop/ui/hopgui/file/workflow/HopGuiWorkflowGraph.java index a7e5b165ee..47e8435cb1 100644 --- a/ui/src/main/java/org/apache/hop/ui/hopgui/file/workflow/HopGuiWorkflowGraph.java +++ b/ui/src/main/java/org/apache/hop/ui/hopgui/file/workflow/HopGuiWorkflowGraph.java @@ -660,6 +660,19 @@ public class HopGuiWorkflowGraph extends HopGuiAbstractGraph Point p = currentAction.getLocation(); iconOffset = new Point(real.x - p.x, real.y - p.y); + + // The RAP/web client does not deliver mouse-move events while a button is held, so the + // movement threshold in mouseMove() can never fire during a press. Arm the drag right + // away on mouse-down so the action follows the cursor and is dropped on mouse-up; + // native + // SWT keeps the threshold behaviour to distinguish a click from a drag. + if (EnvironmentUtils.getInstance().isWeb() && event.button == 1 && !shift && !control) { + actionDragCommitted = true; + dragSelection = true; + canvas.setData("mode", "drag"); + selectedActions = workflowMeta.getSelectedActions(); + selectedAction = currentAction; + } } updateGui(); done = true;
