Skip to content

Commit 71330b1

Browse files
abhishek-shanthkumarDevtools-frontend LUCI CQ
authored and
Devtools-frontend LUCI CQ
committed
Memory: Sort children when populated and not just when expanded
Currently, when we change the sorting by clicking on a column header, the child elements are recursively sorted only when they are expanded. When a node is expanded for the first time, its children are added in the currently set sorting order and the `populated` field is set to true. After this, if the node is collapsed and the sorting is changed, the recursive sorting does not apply to the child elements. When the node is then expanded, the children do not get repopulated and hence they show up in the earlier sorting order, causing the linked bug. This CL fixes it by changing the condition for sorting the children from expanded to populated. Fixed: 361002653 Change-Id: I563648e67687169bc457b6fc8505dd65027ba4ba Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5804462 Reviewed-by: Simon Zünd <[email protected]> Reviewed-by: Seth Brenith <[email protected]> Auto-Submit: Abhishek Shanthkumar <[email protected]> Commit-Queue: Simon Zünd <[email protected]>
1 parent c4a96c5 commit 71330b1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

front_end/panels/profiler/HeapSnapshotDataGrids.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ export class HeapSnapshotSortableDataGrid extends
357357
for (let i = 0, l = children.length; i < l; ++i) {
358358
const child = (children[i] as HeapSnapshotGridNode);
359359
this.appendChildAfterSorting(child);
360-
if (child.expanded) {
360+
if (child.populated) {
361361
void child.sort();
362362
}
363363
}

0 commit comments

Comments
 (0)