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

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

Issue 771283002: Fix focus regression in chrome://settings/editDictionary. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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/options/inline_editable_list.js
diff --git a/chrome/browser/resources/options/inline_editable_list.js b/chrome/browser/resources/options/inline_editable_list.js
index 204ada7ac344e4ba21f35dd8ed18b162530b5192..8f87c8301f4623cb178aacea66e17551542eb5f4 100644
--- a/chrome/browser/resources/options/inline_editable_list.js
+++ b/chrome/browser/resources/options/inline_editable_list.js
@@ -651,12 +651,12 @@ cr.define('options', function() {
onSetDataModelComplete: function() {
DeletableItemList.prototype.onSetDataModelComplete.call(this);
- var firstItem = this.getListItemByIndex(0);
- if (firstItem) {
- firstItem.setStaticValuesFocusable(true);
- firstItem.setCloseButtonFocusable(true);
- if (firstItem.isPlaceholder)
- firstItem.setEditableValuesFocusable(true);
+ var item = this.getInitialFocusableItem();
+ if (item) {
+ item.setStaticValuesFocusable(true);
+ item.setCloseButtonFocusable(true);
+ if (item.isPlaceholder)
+ item.setEditableValuesFocusable(true);
}
},
@@ -668,6 +668,15 @@ cr.define('options', function() {
shouldFocusPlaceholder: function() {
return true;
},
+
+ /**
+ * Override to change which item is initially focusable.
+ * @return {options.InlineEditableItem} Initially focusable item or null.
+ * @protected
+ */
+ getInitialFocusableItem: function() {
bondd 2014/12/02 20:35:02 I made this a regular method instead of an ECMA 5
Dan Beam 2014/12/03 01:40:33 Acknowledged.
+ return this.getListItemByIndex(0);
+ },
};
// Export

Powered by Google App Engine
This is Rietveld 408576698