Skip to content
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

LG-6114: Use Cleave.js to format personal key (IdV app) #6217

Merged
merged 4 commits into from
Apr 19, 2022

Conversation

aduth
Copy link
Member

@aduth aduth commented Apr 18, 2022

Why: So that the value is more readable as the user types, and to ensure feature parity with the existing experience.

Testing Instructions:

  1. Set idv_api_enabled: "true" in local config/application.yml
  2. Go to: http://localhost:3000/verify/v2/personal_key_confirm
  3. Type code into field
  4. Observe that a dash is inserted automatically after every 4th character

Implementation Notes:

Cleave.js includes a built-in React component: https://github.com/nosir/cleave.js#reactjs-component-usage

Initially I had tried to custom-implement the formatting, since Cleave.js is a pretty large dependency, but opted against this approach after realizing it's a pretty tricky implementation!

For follow-up: We should upgrade our version of @testing-library/user-event, since we're using an older version of the API, which will require some breaking changes to upgrade.

**Why**: So that the value is more readable as the user types, and to ensure feature parity with the existing experience.

changelog: Upcoming Features, Identity Verification, Add personal key step screen
Copy link
Contributor

@zachmargolis zachmargolis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

As confirmed via integration specs, Cleave handles this
@aduth aduth merged commit 883e767 into main Apr 19, 2022
@aduth aduth deleted the aduth-lg-6114-personal-key-format branch April 19, 2022 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants