diff --git a/lcl/shellctrls.pas b/lcl/shellctrls.pas index 0ce27a797e..889ac22650 100644 --- a/lcl/shellctrls.pas +++ b/lcl/shellctrls.pas @@ -1352,6 +1352,7 @@ begin Path := selectedPath; // Setting the path expands the selected node --> apply the stored state. Selected.Expanded := selectedWasExpanded; + Selected.HasChildren := NodeHasChildren(Selected); // Avoid selected node to scroll away. TopItem := Items.FindNodeWithTextPath(topNodePath); end;