-
Notifications
You must be signed in to change notification settings - Fork 156
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
update CountryField
to better utilize new paragon Form.Autosuggest
#1133
Comments
add callback "onErrorStateChange" to Form.Autosuggest |
CountryField
to use new paragon Form.Autosuggest
CountryField
to better utilize new paragon Form.Autosuggest
As of #1157 the new Autosuggest component is being used, but not to its full potential None of the internal error state management is being used frontend-app-authn/src/register/RegistrationFields/CountryField/CountryField.jsx Lines 107 to 116 in a6e96f5
instead the error state is managed in frontend-app-authn/src/register/RegistrationFields/CountryField/CountryField.jsx Lines 67 to 85 in a6e96f5
and there are workarounds such as frontend-app-authn/src/register/RegistrationFields/CountryField/CountryField.jsx Lines 90 to 96 in a6e96f5
The comment mentions the lack of frontend-app-authn/src/register/RegistrationFields/CountryField/CountryField.jsx Lines 76 to 78 in 872aa48
which, as of #1157, is just used for updating error state - const { countryCode, displayValue, error } = validateCountryField(
+ const { error } = validateCountryField(
value.trim(), countryList, formatMessage(messages['empty.country.field.error']), formatMessage(messages['invalid.country.field.error']),
);
-
- onChangeHandler({ target: { name: 'country' } }, { countryCode, displayValue });
handleErrorChange('country', error); Therefore, I believe that this can be handled with an |
Hi @brian-smith-tcril, Thank you for this detailed comment. In addition to the missing
We will resume working on this and update country field once we have |
Paragon 22 includes breaking changes for Form.Autosuggest. These should aid in simplifying the implementation of
CountryField
, but some changes may be needed in Paragon to support certain parts of the error handling logic. One part that stands out ishandleErrorChange
as seen here:frontend-app-authn/src/register/RegistrationFields/CountryField/CountryField.jsx
Line 68 in 2ea9301
The text was updated successfully, but these errors were encountered: