-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
updated country selector #10354
base: main
Are you sure you want to change the base?
updated country selector #10354
Conversation
setEditedProfileDetails((prev) => { | ||
const newState = { ...prev, [formName]: value }; | ||
return newState; | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think putting it on two lines is necessary
search | ||
value={editedProfileDetails?.country_iso2} | ||
onChange={handleFormChange} | ||
selected={editedProfileDetails?.country_iso2} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
selected
is not a supported property by CountrySelector
. You should pass it as countryIso2
@@ -102,13 +100,10 @@ export default function EditProfileForm({ | |||
onChange={handleFormChange} | |||
required | |||
/> | |||
<Form.Select | |||
options={countryOptions} | |||
<CountrySelector | |||
label={i18n.t('activerecord.attributes.user.country_iso2')} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
label
is not a supported property by CountrySelector
.
value={editedProfileDetails?.country_iso2} | ||
onChange={handleFormChange} | ||
selected={editedProfileDetails?.country_iso2} | ||
onChange={(event, data) => handleFormChange(null, { name: 'country_iso2', value: data.value })} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you keep passing in name
(not sure why you deleted that in the first place), then just keeping onChange={handleFormChange}
should work
Fixed the issue, where we shouldn't allow multiple countries to be selected. To fix this I replaced the country selector of EditProfileForm with the existing CountrySelector.
Issue: #10283