Skip to content

Commit da7dab9

Browse files
committed
Improved fix for #692: Prevent the OnNodeClick event from being fired twice.
1 parent 4050bd0 commit da7dab9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Source/VirtualTrees.pas

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22825,8 +22825,10 @@ procedure TBaseVirtualTree.HandleMouseUp(var Message: TWMMouse; const HitInfo: T
2282522825
if (FHeader.FColumns.FClickIndex > NoColumn) and (FHeader.FColumns.FClickIndex = HitInfo.HitColumn) then
2282622826
DoColumnClick(HitInfo.HitColumn, KeysToShiftState(Message.Keys));
2282722827

22828-
if FLastHitInfo.HitNode <> nil then // Use THitInfo of mouse down here, see issue #692
22829-
DoNodeClick(FLastHitInfo);
22828+
if FLastHitInfo.HitNode <> nil then begin // Use THitInfo of mouse down here, see issue #692
22829+
DoNodeClick(FLastHitInfo);
22830+
FLastHitInfo.HitNode := nil; // prevent firing the event again
22831+
end;
2283022832

2283122833
// handle a pending edit event
2283222834
if tsEditPending in FStates then

0 commit comments

Comments
 (0)