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

(Bug) email/sms code verification not responsive #2796

Merged
merged 1 commit into from
Dec 10, 2020

Conversation

MarianoAmado
Copy link
Contributor

Description

Fixing verification code inputs (setSpan error) (known bug):

Refactored OtpInput.js Input component's logic for setting the selection

  • Moved logic to custom hook
  • Checking if value is empty before setting the selection
  • Pass selection prop to TextInput only if value is not empty

This affected both email/sms code verification on signup & when editing profile

About #2765

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

Checklist:

  • PR title matches follow: (Feature|Bug|Chore) Task Name
  • My code follows the style guidelines of this project
  • I have followed all the instructions described in the initial task (check Definitions of Done)
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have added reference to a related issue in the repository
  • I have added a detailed description of the changes proposed in the pull request. I am as descriptive as possible, assisting reviewers as much as possible.
  • I have added screenshots related to my pull request (for frontend tasks)
  • I have pasted a gif showing the feature.
  • @mentions of the person or team responsible for reviewing proposed changes

Refactored OtpInput.js Input component's logic for setting the selection (to cover for known bug in TextInput)
@@ -74,16 +74,29 @@ const getSingleOtpInputStylesFromProps = ({ theme }) => ({
},
})

const useTextInputSelection = (value, setSelection) => {
const hasValue = useMemo(() => value && value.length, [value])
Copy link
Contributor

Choose a reason for hiding this comment

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

you could use isEmpty from lodash

@sirpy sirpy merged commit 9cd6eb6 into master Dec 10, 2020
@sirpy sirpy deleted the 2765-rn-verification-input-error branch December 10, 2020 21:03
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.

3 participants