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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorDropdownField.java

Issue 2475323003: [Payments] Fix credit card scanning billing address bug. (Closed)
Patch Set: Optimized condition Created 4 years, 1 month 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/android/java/src/org/chromium/chrome/browser/payments/ui/EditorDropdownField.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorDropdownField.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorDropdownField.java
index 6113e9b980407f10c4da686b17d2e28e2a0ae1b0..e99cb942c825f63b07ebf7558d382fe6f78b5c90 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorDropdownField.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorDropdownField.java
@@ -144,8 +144,15 @@ class EditorDropdownField implements EditorFieldView {
@Override
public void update() {
- mSelectedIndex =
+ // If the adapter supports a hint and no value was selected, select the hint.
+ if (mFieldModel.getHint() != null && mFieldModel.getValue() == null) {
+ // The hint is hidden right after the last element.
+ mSelectedIndex = mFieldModel.getDropdownKeyValues().size();
+ } else {
+ mSelectedIndex =
getDropdownIndex(mFieldModel.getDropdownKeyValues(), mFieldModel.getValue());
+ }
+
mDropdown.setSelection(mSelectedIndex);
}
« 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