Commit 5fc05e23 authored by Rachel Sugrono's avatar Rachel Sugrono Committed by Commit Bot

[quickview] Reorder the current index wrapping

When an item in a check-select is deleted, onFileSelectionChanged_
must ensure that the current index wraps to stay in bounds of the new
selection. When we wrap, favor the bottom entry.

Tests coming.

Tbr: alex
Bug: 803259
Change-Id: I0a6c1f4a22770ad48040695f2b170dcd0db50459
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2035474Reviewed-by: default avatarNoel Gordon <noel@chromium.org>
Commit-Queue: Noel Gordon <noel@chromium.org>
Commit-Queue: Rachel Sugrono <rsugrono@google.com>
Cr-Commit-Position: refs/heads/master@{#738413}
parent 9610f4ff
......@@ -339,9 +339,9 @@ class QuickViewController {
}
if (this.currentSelection_ >= this.entries_.length) {
this.currentSelection_ = 0;
} else if (this.currentSelection_ < 0) {
this.currentSelection_ = this.entries_.length - 1;
} else if (this.currentSelection_ < 0) {
this.currentSelection_ = 0;
}
}
......
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