Skip to content

Commit 273dfcd

Browse files
committed
Fix OnChange event with post nil if the note is the same
I’m submitting a fix for the OnChange event, which incorrectly set the node to nil when clicking on an already selected node. This behavior is incorrect. The event should always provide the node being switched to; otherwise, nil would mean that no node is selected at all. Moreover, this worked differently in earlier versions of VT, where the parameter was never nil.
1 parent 8afd48e commit 273dfcd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Source/VirtualTrees.BaseTree.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12607,7 +12607,7 @@ procedure TBaseVirtualTree.HandleMouseDown(var Message: TWMMouse; var HitInfo: T
1260712607
if NeedChangeEvent then
1260812608
begin
1260912609
Invalidate;
12610-
Change(nil);
12610+
Change(HitInfo.HitNode);
1261112611
end;
1261212612
end
1261312613
else if (toAlwaysSelectNode in Self.TreeOptions.SelectionOptions) then

0 commit comments

Comments
 (0)