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

Unified Diff: chrome/browser/resources/settings/controls/settings_dropdown_menu.html

Issue 2446003002: settings-dropdown-menu must set <select>#value after its options change (Closed)
Patch Set: Created 4 years, 2 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/settings/controls/settings_dropdown_menu.html
diff --git a/chrome/browser/resources/settings/controls/settings_dropdown_menu.html b/chrome/browser/resources/settings/controls/settings_dropdown_menu.html
index a772446aa15bfdd83ff13fced48d7a79313dd945..b13cbde24df41a1bf333c56b8a104453cd47cc29 100644
--- a/chrome/browser/resources/settings/controls/settings_dropdown_menu.html
+++ b/chrome/browser/resources/settings/controls/settings_dropdown_menu.html
@@ -10,13 +10,13 @@
<style include="settings-shared md-select"></style>
<div class="md-select-wrapper">
<select class="md-select" id="dropdownMenu" on-change="onChange_"
- value="[[selected_]]"
disabled="[[shouldDisableMenu_(disabled, menuOptions)]]">
<template is="dom-repeat" items="[[menuOptions]]">
<option value="[[item.value]]">[[item.name]]</option>
</template>
<option value="[[notFoundValue_]]"
- hidden$="[[!isSelectedNotFound_(selected_)]]">
+ hidden$="[[!showNotFoundValue_(menuOptions, pref.value)]]"
dpapad 2016/10/25 01:02:38 showNotFoundValue is performing an O(n) search, fo
dpapad 2016/10/25 01:13:32 Ah, just noticing, this <option> is outside of the
michaelpg 2016/10/25 01:14:37 The search is O(n) and happens: twice whenever m
+ disabled="[[!showNotFoundValue_(menuOptions, pref.value)]]">
dpapad 2016/10/25 01:18:09 So to avoid calculating the same boolean twice, ca
michaelpg 2016/10/26 01:23:10 Nice, done.
$i18n{custom}
</option>
</select>

Powered by Google App Engine
This is Rietveld 408576698