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

Unified Diff: chrome/browser/resources/options/deletable_item_list.js

Issue 429073006: Take care not to destroy a multi-selection when a child element of a list item receives focus. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/options/deletable_item_list.js
diff --git a/chrome/browser/resources/options/deletable_item_list.js b/chrome/browser/resources/options/deletable_item_list.js
index 4f223bad57802ee00c8472335ac9d6207863a788..ebb4517b9723da48f12293db1041ae1d99e20dd3 100644
--- a/chrome/browser/resources/options/deletable_item_list.js
+++ b/chrome/browser/resources/options/deletable_item_list.js
@@ -94,8 +94,15 @@ cr.define('options', function() {
handleFocus_: function() {
Dan Beam 2014/07/30 19:05:34 if (this.selected) return;
engedy 2014/07/31 09:35:48 Done.
var list = this.parentNode;
var index = list.getIndexOfListItem(this);
- list.selectionModel.selectedIndex = index;
- list.selectionModel.anchorIndex = index;
+
+ // This handler is also fired when the child receives focus as a result of
+ // the item getting selected by the customized mouse/keyboard handling in
+ // SelectionController. Take care not to destroy a potential multiple
+ // selection in this case.
+ if (!this.selected) {
+ list.selectionModel.selectedIndex = index;
+ list.selectionModel.anchorIndex = index;
+ }
},
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698