Skip to content

fix(SplineWidget): fix bug where SplineWidget handles cannot be dragged after creation#3400

Merged
finetjul merged 1 commit intoKitware:masterfrom
TreatTrick:master
Feb 5, 2026
Merged

fix(SplineWidget): fix bug where SplineWidget handles cannot be dragged after creation#3400
finetjul merged 1 commit intoKitware:masterfrom
TreatTrick:master

Conversation

@TreatTrick
Copy link
Contributor

Context

  1. Execute command: Run npm run example SplineWidget.
  2. Open the example in your browser, click "Place Widget" in the top-right corner, and add several points. Press Enter to confirm and create the SplineWidget.
  3. Hover the mouse over any handle (control point) of the SplineWidget and attempt to drag it using the left mouse button.

Results

The handles are unresponsive; the control points cannot be dragged or moved.

Changes

Root Cause Analysis: The issue occurs because the handleMouseMove method in SplineWidget does not return macro.EVENT_ABORT when isHandleMoving is true. Even though the widget is currently in a dragging state, the mouse event continues to propagate to other subscribers. Consequently, the WidgetManager captures the event and triggers the w.deactivateAllHandles() method, which deactivates the currently selected handle and interrupts the drag operation.

Proposed Fix: To resolve this, we must return macro.EVENT_ABORT within the handleMouseMove logic whenever isHandleMoving is true. This ensures that the event is consumed by the active widget and prevented from propagating to the WidgetManager or other listeners.

PR and Code Checklist

  • semantic-release commit messages
  • Run npm run reformat to have correctly formatted code

Testing

  • Tested environment:
    • vtk.js: latest master
    • OS: Windows 11
    • Browser: Chrome: 144.0.7559.112

Copy link
Collaborator

@sankhesh sankhesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@finetjul finetjul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You wouldn't need it if the widget had the focus while dragging the control point. However it seems that other widgets don't do that.
Let's merge your change but let's keep in mind that widget should probably grab focus in the future.

@finetjul finetjul added this pull request to the merge queue Feb 5, 2026
Merged via the queue into Kitware:master with commit fa6d124 Feb 5, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants