Commit 4540534e authored by Jeremie Boulic's avatar Jeremie Boulic Committed by Commit Bot

Fix unnecessary blink of new created folders

When creating new folders from the directory tree, the new entry was
sometimes added in the wrong spot due to the way labels were compared.
The folders were then immediately reordered, causing the new folder to
lose its renaming state with the corresponding input box.

Issue fixed using the util.compareName function.

Test to be added.

Bug: 1004717
Change-Id: I1005e1061b099b195ea87d4b50b0a121f17d593b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1855145
Commit-Queue: Jeremie Boulic <jboulic@chromium.org>
Commit-Queue: Noel Gordon <noel@chromium.org>
Reviewed-by: default avatarNoel Gordon <noel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#704983}
parent ad005f06
...@@ -1856,7 +1856,7 @@ class DirectoryTree extends cr.ui.Tree { ...@@ -1856,7 +1856,7 @@ class DirectoryTree extends cr.ui.Tree {
let addAt = 0; let addAt = 0;
while (addAt < parentItem.items.length && while (addAt < parentItem.items.length &&
parentItem.items[addAt].entry.name < newDirectory.name) { util.compareName(parentItem.items[addAt].entry, newDirectory) < 0) {
addAt++; addAt++;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment