UDS-1933: feat(app-rfi): added a patch for react-phone-input-2 #1470
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
UDS-1933
Rearrange components in
react-phone-input-2
to improve accessibility, making navigation and usage easier for users with disabilities.Test Steps:
yarn
command in the source directory in order to install dependencies and apply patch.yarn storybook
Verification:
Ensure that when using the Tab key for navigation, the focus first lands on the flag input before the phone number input.
Form :
http://localhost:XXXX/?path=/story/uds-asurfi--default
Solution added to the library :
Issue : Country select dropdown menu receives Tab navigation focus after phone text field - Accesibility issue · Issue chore(deps): bump node-forge from 1.2.0 to 1.3.0 #708 · bl00mber/react-phone-input-2
PR : fix: correct tab order for country code dropdown (#708). by juanmitriatti · Pull Request #709 · bl00mber/react-phone-input-2
To resolve this ticket, which required adding a custom patch to the UDS project, I followed these steps in the React phone library code:
Solution - Technical steps :
yarn patch
Yarn patch <package>
This command will cause a package to be extracted in a temporary directory intended to be editable at will.Once you're done with your changes, run
yarn [patch-commit](https://yarnpkg.com/cli/patch-commit) -s path
(with path being the temporary directory you received) to generate a patchfile and register it into your top-level manifest via the patch: protocol. Run yarn patch-commit -h for more details.Description
Links