Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3778)

Unified Diff: chrome/browser/resources/md_history/list_container.js

Issue 2371363002: [MD History] Fix item selection when deleting via menu item. (Closed)
Patch Set: uglify, fix comment Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/md_history/list_container.js
diff --git a/chrome/browser/resources/md_history/list_container.js b/chrome/browser/resources/md_history/list_container.js
index 72aaa61d2af3307eb91304fa5f7985617ed113f3..5028965cdde8530275a74898aa19918252bd9726 100644
--- a/chrome/browser/resources/md_history/list_container.js
+++ b/chrome/browser/resources/md_history/list_container.js
@@ -238,11 +238,13 @@ Polymer({
var itemData = menu.itemData;
browserService.deleteItems([itemData.item])
.then(function(items) {
- this.getSelectedList_().removeItemsByPath([itemData.path]);
- // This unselect-all is to reset the toolbar when deleting a selected
- // item. TODO(tsergeant): Make this automatic based on observing list
+ // This unselect-all resets the toolbar when deleting a selected item
+ // and clears selection state which can be invalid if items move
+ // around during deletion.
+ // TODO(tsergeant): Make this automatic based on observing list
// modifications.
this.fire('unselect-all');
+ this.getSelectedList_().removeItemsByPath([itemData.path]);
var index = itemData.index;
if (index == undefined)
« no previous file with comments | « chrome/browser/resources/md_history/lazy_load.vulcanized.html ('k') | chrome/test/data/webui/md_history/history_list_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698