Skip to content

fix(tree): prevent node expansion when double-clicking checkbox#17372

Open
YueCHEN195 wants to merge 1 commit intoeclipse-theia:masterfrom
YueCHEN195:fix-tree-checkbox-doubleclick
Open

fix(tree): prevent node expansion when double-clicking checkbox#17372
YueCHEN195 wants to merge 1 commit intoeclipse-theia:masterfrom
YueCHEN195:fix-tree-checkbox-doubleclick

Conversation

@YueCHEN195
Copy link
Copy Markdown
Contributor

What it does

Currently, in the TreeWidget, rapid consecutive clicks (a double-click) on a node's checkbox will bubble up to the tree node row. Because the checkbox only stops the propagation of onClick but not onDoubleClick, the handleDblClickEvent of the tree row is triggered. This results in the unintended behavior where double-clicking a checkbox causes the tree node to expand or collapse.

This PR fixes the issue by adding an onDoubleClick event handler to the checkbox <input> element in renderCheckbox and calling e.stopPropagation(). This ensures that double-click events on the checkbox are consumed by the checkbox itself and do not trigger the tree node's default expansion/collapse behavior.

How to test

  1. Open or implement any view in Theia that utilizes a TreeWidget with checkboxes enabled (i.e., nodes returning valid checkboxInfo).
  2. Rapidly double-click on the checkbox of a collapsible node (a directory/folder node).
  3. Before this PR: The checkbox state toggles, but the tree node also expands/collapses unexpectedly.
  4. After this PR: The checkbox state toggles rapidly, and the tree node remains in its current expansion state without expanding or collapsing.

Breaking changes

  • This PR introduces breaking changes and requires careful review. If yes, the breaking changes section in the changelog has been updated.

Attribution

Review checklist

Reminder for reviewers

@github-project-automation github-project-automation Bot moved this to Waiting on reviewers in PR Backlog Apr 20, 2026
@YueCHEN195 YueCHEN195 marked this pull request as draft April 20, 2026 05:18
@YueCHEN195 YueCHEN195 force-pushed the fix-tree-checkbox-doubleclick branch from cef4ab5 to dec8595 Compare April 21, 2026 01:11
@YueCHEN195 YueCHEN195 marked this pull request as ready for review April 21, 2026 01:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Waiting on reviewers

Development

Successfully merging this pull request may close these issues.

1 participant