Project

General

Profile

Actions

Improvements #14226

open

Prevent item selection when clicking expand/collapse buttons in WTreeView

Added by Marnik Roosen 5 days ago. Updated 5 days ago.

Status:
Review
Priority:
Normal
Assignee:
-
Target version:
Start date:
12/24/2025
Due date:
% Done:

0%

Estimated time:

Description

In WTreeView, clicking the expand/collapse button currently triggers row selection.
This can lead to accidental selection/deselection of items when the user merely intends to navigate the tree hierarchy.
The behavior is also inconsistent with WTree, where the expand/collapse button does not trigger row selection.
We should prevent row selection in these cases.

Root cause: The ToggleButton inside WTreeViewNode allows mouse events to bubble up to the WTreeView container. The view-level event handler onItemEvent intercepts these events and triggers the selection logic, regardless of whether the click landed on the toggle button or the item content.

Proposed fix: Modify WTreeViewNode::updateGraphics to prevent event propagation on the expansion control widgets. This ensures the event is consumed by the button and does not reach the parent view's selection handlers.

Actions #1

Updated by Marnik Roosen 5 days ago

  • Status changed from InProgress to Review
  • Assignee deleted (Marnik Roosen)
Actions

Also available in: Atom PDF