Improvements #14226
openPrevent item selection when clicking expand/collapse buttons in WTreeView
0%
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.
Updated by Marnik Roosen 5 days ago
- Status changed from InProgress to Review
- Assignee deleted (
Marnik Roosen)