Skip to content

Commit 8efb225

Browse files
fix: add new entry for another US label (openedx#1244)
Add new entry for for another US label which is United States
1 parent 73e8913 commit 8efb225

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/register/RegistrationFields/CountryField/CountryField.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ const CountryField = (props) => {
9797
};
9898

9999
const getCountryList = () => countryList.map((country) => (
100-
<FormAutosuggestOption key={country[COUNTRY_CODE_KEY]} id={country[COUNTRY_CODE_KEY]}>
100+
<FormAutosuggestOption key={country[COUNTRY_DISPLAY_KEY]} id={country[COUNTRY_CODE_KEY]}>
101101
{country[COUNTRY_DISPLAY_KEY]}
102102
</FormAutosuggestOption>
103103
));

src/register/components/ConfigurableRegistrationForm.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ const ConfigurableRegistrationForm = (props) => {
3333
autoSubmitRegistrationForm,
3434
} = props;
3535

36-
const countryList = useMemo(() => getCountryList(getLocale()), []);
36+
/** The reason for adding the entry 'United States' is that Chrome browser aut-fill the form with the 'Unites
37+
States' instead of 'United States of America' which does not exist in country dropdown list and gets the user
38+
confused and unable to create an account. So we added the United States entry in the dropdown list.
39+
*/
40+
const countryList = useMemo(() => getCountryList(getLocale()).concat([{ code: 'US', name: 'United States' }]), []);
3741

3842
let showTermsOfServiceAndHonorCode = false;
3943
let showCountryField = false;

0 commit comments

Comments
 (0)