Closed Bug 1474905 Opened 2 years ago Closed 2 years ago

Use a dropdown for the state/province field, where possible


(Toolkit :: Form Autofill, defect, P1)

63 Branch



Tracking Status
firefox66 --- verified


(Reporter: hani.yacoub, Assigned: jaws)


(Depends on 1 open bug, Blocks 1 open bug)


(Whiteboard: [webpayments])

User Story

If we have the list of available regions/provinces/states from our address data, we should display a dropdown instead of a text field.

We need to handle:
* autofill (trying to) save a value that isn't one of the options.
* countries where we don't have the list of regions


(2 files)

[Affected versions]: 
Nightly 63.0a1

[Affected platforms]:
Platforms: Windows 10 x 64, Mac OS X 10.12 and Ubuntu 16.04 x64.

[Steps to reproduce]:
1. In about:config set the pref dom.payments.request.enabled to "true".
2. Go to "" page and click on "Buy".
3. For FTU flow add shipping address and payment method information by filling all the required fields correctly and make sure state is California and click on "Save".
4. Or in case you have already saved addresses or payment methods.
5. From "Payment method" page click on "add" under "Shipping option" section and fill all the required fields correctly and make sure state is California and click on "Save".

[Expected result]:
"$0.00 Free shipping in California" should be displayed under shipping option ones the state address is California.

[Actual result]:
Adding an address from California isn't reflected on the shipping option.
Under shipping option "$5.00 Standard shipping in US" is displayed instead of "$0.00 Free shipping in California".
Whiteboard: [webpayments] [triage]
Priority: -- → P2
Whiteboard: [webpayments] [triage] → [webpayments]
Did you have the value "California" in the state field or "CA"? I think you have "California" and that's the issue since we need to return "CA". Can you confirm the problem doesn't happen with a state of "CA"
Flags: needinfo?(hani.yacoub)
Yes, I did have the value "California" in the state field. I changed it to "CA" and now it's not reproducible. 
I'll change the status to Invalid.
Closed: 2 years ago
Flags: needinfo?(hani.yacoub)
Resolution: --- → INVALID
Priority: P2 → --
Whiteboard: [webpayments]
We can use this bug to track converting to a dropdown for the state/province field.
User Story: (updated)
Priority: -- → P3
Resolution: INVALID → ---
Summary: Adding an address from California isn't reflected on the shipping option → Use a dropdown for the state/province field, where possible
Whiteboard: [webpayments-reserve]
This should use the sub_keys and sub_names properties in addressReferences.js to build the dropdown. The sub_keys will be used for the regionCode and sub_names will be used for the region.
Assignee: nobody → jaws
Priority: P3 → P1
Flags: qe-verify?
Whiteboard: [webpayments-reserve] → [webpayments]
Component: WebPayments UI → Form Autofill
Flags: qe-verify? → qe-verify+
Product: Firefox → Toolkit
QA Contact: hani.yacoub
Pushed by
Use a dropdown for the state/province field when possible. r=MattN
Backed out for browser chrome failures on browser_editCreditCardDialog.js

Push with failures:

Failure log:

Backout link:

[task 2018-12-14T19:35:26.079Z] 19:35:26     INFO - TEST-PASS | browser/extensions/formautofill/test/browser/browser_editCreditCardDialog.js | cc-number field should be showing invalid credit card number - 
[task 2018-12-14T19:35:26.080Z] 19:35:26     INFO - Buffered messages finished
[task 2018-12-14T19:35:26.082Z] 19:35:26     INFO - TEST-UNEXPECTED-FAIL | browser/extensions/formautofill/test/browser/browser_editCreditCardDialog.js | save button should be disabled due to invalid credit card number - 
[task 2018-12-14T19:35:26.082Z] 19:35:26     INFO - Stack trace:
[task 2018-12-14T19:35:26.083Z] 19:35:26     INFO - chrome://mochikit/content/browser-test.js:test_ok:1292
[task 2018-12-14T19:35:26.083Z] 19:35:26     INFO - chrome://mochitests/content/browser/browser/extensions/formautofill/test/browser/browser_editCreditCardDialog.js:test_editInvalidCreditCardNumber/<:281
[task 2018-12-14T19:35:26.084Z] 19:35:26     INFO - chrome://mochitests/content/browser/browser/extensions/formautofill/test/browser/head.js:testDialog:361
[task 2018-12-14T19:35:26.084Z] 19:35:26     INFO - chrome://mochitests/content/browser/browser/extensions/formautofill/test/browser/browser_editCreditCardDialog.js:test_editInvalidCreditCardNumber:277
[task 2018-12-14T19:35:26.084Z] 19:35:26     INFO - chrome://mochikit/content/browser-test.js:Tester_execTest/<:1093
[task 2018-12-14T19:35:26.085Z] 19:35:26     INFO - chrome://mochikit/content/browser-test.js:Tester_execTest:1084
[task 2018-12-14T19:35:26.086Z] 19:35:26     INFO - chrome://mochikit/content/browser-test.js:nextTest/<:982
[task 2018-12-14T19:35:26.087Z] 19:35:26     INFO - chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:SimpleTest.waitForFocus/waitForFocusInner/focusedOrLoaded/<:803
Flags: needinfo?(jaws)
Flags: needinfo?(jaws)
Closed: 2 years ago2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla66

I confirm that "state/province" field are displayed, where possible (ex. US, CA and AU).
Verified as fixed on Firefox Nightly 66.0a1 on Windows 10 x 64, Mac OS X 10.13 and on Ubuntu 16.04 x64.

Logged Bug 1519081 - "State" field is displayed even after selecting a Country/Region with no list of state/Province

Flags: qe-verify+
Depends on: 1519081
Depends on: 1519788
You need to log in before you can comment on or make changes to this bug.