-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent crash after moving the last item from a folder
Existing logic of unfoldering the last item to the right: 1) calculate target position as "folder index + 1"; 2) move item at that position; 3) delete the folder; 4) reparented item moves one position back. The issue was that code continues using position from 1) after 4). This leads to: 1) focusing the wrong (+ 1) item, if the folder was not at the end; 2) crash, if the folder was at the end of the grid. (cherry picked from commit efe4528) Bug: b/262715563 Change-Id: I3208635b8b612057440fc5be993bd8abb5e40b1b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4117547 Reviewed-by: Toni Barzic <tbarzic@chromium.org> Commit-Queue: Artsiom Mitrokhin <amitrokhin@chromium.org> Cr-Original-Commit-Position: refs/heads/main@{#1086060} Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4135539 Cr-Commit-Position: refs/branch-heads/5481@{#120} Cr-Branched-From: 130f3e4-refs/heads/main@{#1084008}
- Loading branch information
Artsiom Mitrokhin
authored and
Chromium LUCI CQ
committed
Jan 4, 2023
1 parent
8b1140e
commit 55bc7f1
Showing
2 changed files
with
49 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters