-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[$1000] Log in - User unable to proceed after re-enter last digit of magic code number #21958
Comments
Triggered auto assignment to @CortneyOfstad ( |
Bug0 Triage Checklist (Main S/O)
|
ProposalPlease re-state the problem that we are trying to solve in this issue.The user is unable to change the magic code if an error has occurred without refocusing manually. What is the root cause of that problem?Upon submitting, the magic code input is blurred: App/src/pages/signin/ValidateCodeForm/BaseValidateCodeForm.js Lines 200 to 202 in 0bbf3fc
What changes do you think we should make in order to solve the problem?Remove the automatic blurring of the input. What alternative solutions did you explore? (Optional)An alternative solution is to keep the auto blurring of the input, but refocus only if an error subsequently occurs. EDIT: Added code snippet. |
ProposalPlease re-state the problem that we are trying to solve in this issue.User able to proceed after re-enter last digit of magic code number What is the root cause of that problem?The cause of this problem lies here: App/src/components/MagicCodeInput.js Lines 214 to 218 in 0bbf3fc
What changes do you think we should make in order to solve the problem?We will update: when in the last input box, we will always take the last value of the user entered `value let numbersArr = []
numbersArr = value
.trim()
.split('')
.slice(0, props.maxLength - editIndex);
// handle the last number if after entering the last number but still enter:
let newValue = '';
if (value.length > props.maxLength - editIndex) {
const lastInput = value[value.length - 1];
numbersArr[numbersArr.length - 1] = lastInput;
newValue = value.slice(0, props.maxLength - editIndex) + lastInput;
}
setInput(newValue || value); Also we need to remove the limit Screen.Recording.2023-06-30.at.22.53.11.mov ### What alternative solutions did you explore? (Optional) |
Job added to Upwork: https://www.upwork.com/jobs/~01306ade9d70001f15 |
Current assignee @CortneyOfstad is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @eVoloshchak ( |
I am heading OoO for the week (back July 10) so re-assigning this in the meantime 👍 |
Triggered auto assignment to @mallenexpensify ( |
Bug0 Triage Checklist (Main S/O)
|
ProposalPlease re-state the problem that we are trying to solve in this issue.When clicked/touched on the last digit of a magic code input that is previously non-empty, upon re-inputting the same digit as previously entered (i.e. the last digit was previously 6, user presses 6 again after clicking the last digit), the code will not auto submit and nor will any further digit inputs will update the last digit. What is the root cause of that problem?The handling of the underlying text input in magic code input component is implemented incorrectly to handle the case when the user re-types the same last digit as the previously entered one. App/src/components/MagicCodeInput.js Lines 214 to 217 in 0bbf3fc
What changes do you think we should make in order to solve the problem?Recommended Approach:I think there's a good opportunity to improve MagicCodeInput component and the magic code UX for Expensify (see alterative solutions explored section). Fixing the existing implementation:Split up the underlying text input to: const valueAsNumbers = value.trim().split('');
const numDigitsToTakeIfValueIsPastMaxLength = props.maxLength - editIndex - 1;
const numDigitsToTakeIfValueIsShorterThanMaxLength = value.length - 1;
const numDigitsToTake = Math.min(numDigitsToTakeIfValueIsPastMaxLength, numDigitsToTakeIfValueIsShorterThanMaxLength);
const valueUpToLastDigit = value.slice(0, numDigitsToTake);
const lastDigitInValue = valueAsNumbers[valueAsNumbers.length - 1];
const effectiveValueAsNumbers = [...valueUpToLastDigit, lastDigitInValue];
const updatedFocusedIndex = Math.min(editIndex + (effectiveValueAsNumbers.length - 1) + 1, props.maxLength - 1);
let numbers = decomposeString(props.value, props.maxLength);
numbers = [...numbers.slice(0, editIndex), ...effectiveValueAsNumbers, ...numbers.slice(effectiveValueAsNumbers.length + editIndex, props.maxLength)]; What alternative solutions did you explore?Opinionated Statement: The complexity of the magic code input can be reduced drastically if we opt for better UX choices. Clear on incorrect submissionMaintain focus on the magic input and clear it upon an unsuccessful code entry. Don't let users enter past the first empty indexClaim: Allowing users to enter digits past the first empty digit is practically useless - arguably nobody fills starting from mid-way through and if it happens, it's probably a mistake. If the user loses focus on the text input, let them click anywhere on the magic code and automatically register the input for the first empty digit. Along with clear on incorrect submission, this will entirely remove the need for complicated input-index/focus-index state management. If we don't like to clear input, this would still be a worth improvement on its own. Edit: Removed anchor links to comment sections - they weren't working. Clarifications and typo/styling fixes. |
Looks like something related to As a reminder, please make sure that all proposals are not workarounds and that any and all attempt to fix the issue holistically have been made before proceeding with a solution. Proposals to change our Feel free to drop a note in #expensify-open-source with any questions. |
📣 @ugur-akin! 📣
|
Contributor details |
✅ Contributor details stored successfully. Thank you for contributing to Expensify! |
Please re-state the problem that we are trying to solve in this issue.User unable to proceed after re-enter last digit of magic code What is the root cause of that problem?This issue is caused by following reason
What changes do you think we should make in order to solve the problem?
|
Works for me, thanks for keeping a pulse on it |
Still on hold for #28711 |
Actively being worked on |
Still on hold, there's movement on the PR |
Linked PR is still open |
Discussing in Slack |
@samh-nl do you want to work on this? |
This is now expected behavior and can be closed. Also dupe of #31798 |
Sorry for the reduced responsiveness. In principle I'd like to further pursue this following the holding PR is now merged. The issues referenced by @mkhutornyi do make it seem redundant, however. We currently only auto-submit the first time, allowing the user to adjust multiple digits down the line without it resubmitting automatically. Our issue here would undo this 'new' behavior. |
Agreed, and thanks for the links @mkhutornyi. Let's close this then - @mallenexpensify can you handle any payments that may be due for work completed to date? Thanks! |
Thanks all! |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Action Performed:
Expected Result:
User able to proceed after re-enter last digit of magic code number
Actual Result:
User unable to proceed after re-enter last digit of magic code number
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.34-1
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
RPReplay_Final1688038420.MP4
RPReplay_Final1688136839.MP4
Expensify/Expensify Issue URL:
Issue reported by: @namhihi237
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1688039417283349
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @mallenexpensifyThe text was updated successfully, but these errors were encountered: