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

[$500] The tricky emoji is displayed incorrectly in the expiration date and CVV section #31393

Closed
6 tasks done
kbecciv opened this issue Nov 15, 2023 · 7 comments
Closed
6 tasks done
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@kbecciv
Copy link

kbecciv commented Nov 15, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 1.3.99.0
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
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

Issue found when executing PR #31259

Action Performed:

  1. Go to staging.new.expensify.com
  2. Log in with any account
  3. Go to Setting - Wallet
  4. Select Add bank account - Debit card
  5. Input with emojis, especially tricky ones (e.g. 😶‍🌫️)

Expected Result:

The tricky emoji is displayed correctly in the expiration date and CVV section or user cannot use emojis for two fields.

Actual Result:

The tricky emoji is displayed incorrectly in the expiration date and CVV section

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Recording.5420.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0133f13d68bcdd3d58
  • Upwork Job ID: 1724839362727112704
  • Last Price Increase: 2023-11-15
@kbecciv kbecciv added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Nov 15, 2023
@melvin-bot melvin-bot bot changed the title The tricky emoji is displayed incorrectly in the expiration date and CVV section [$500] The tricky emoji is displayed incorrectly in the expiration date and CVV section Nov 15, 2023
Copy link

melvin-bot bot commented Nov 15, 2023

Triggered auto assignment to @strepanier03 (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

Copy link

melvin-bot bot commented Nov 15, 2023

Job added to Upwork: https://www.upwork.com/jobs/~0133f13d68bcdd3d58

Copy link

melvin-bot bot commented Nov 15, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 15, 2023
Copy link

melvin-bot bot commented Nov 15, 2023

Triggered auto assignment to Contributor-plus team member for initial proposal review - @ntdiary (External)

@yh-0218
Copy link
Contributor

yh-0218 commented Nov 15, 2023

Proposal

Please re-state the problem that we are trying to solve in this issue.

The tricky emoji is displayed incorrectly in the expiration date and CVV section

What is the root cause of that problem?

Because we have maxLength here and here
😶‍🌫️ -> length = 6
😶‍ -> length = 3
Max length = 4

What changes do you think we should make in order to solve the problem?

Option 1:
We can skip this issue.

Option 2:
We can allow only number input.

Option 3:
We can increase maxLength

What alternative solutions did you explore? (Optional)

Screenshot 2023-11-15 at 8 24 48 PM

@yakupafsin
Copy link
Contributor

Proposal

Please re-state the problem that we are trying to solve in this issue.

The issue revolves around the incorrect display of a specific emoji in the expiration date and CVV sections

What is the root cause of that problem?

The root cause lies in the UTF-16 encoding used by JavaScript, treating emojis as multiple characters. This conflicts with the maxLength setting of the text input field, causing the incorrect rendering of emojis.

What changes do you think we should make in order to solve the problem?


To address this issue, we propose implementing the following changes in the onInputChange() function within Form.js:

// Check if the input has 'numeric' input mode
const isNumericInput = inputMode === CONST.INPUT_MODE.NUMERIC;
                    
// Only allow numeric values for inputs with 'numeric' input mode
const sanitizedValue = isNumericInput ? value.replace(CONST.REGEX.NUMERIC, '') : value;               

Subsequently, replace instances of the variable 'value' with 'sanitizedValue' in the onInputChange function. This modification ensures that users cannot input non-numeric characters in fields with the 'numeric' input mode, preventing current and potential issues.

By restricting input to numeric values in fields with 'numeric' input mode, we eliminate the problem at its source and mitigate future issues. This solution maintains the integrity of numeric inputs while addressing the root cause of the emoji display problem.

What alternative solutions did you explore? (Optional)

While not ideal, an alternative solution is to remove the maxLength restriction in the text input fields. This would allow the proper rendering of emojis but may introduce issues related to input length. Consider this option cautiously, as it might impact the expected behavior of the form.

Screen record

Screen.Recording.2023-11-15.at.20.33.13.mov

@strepanier03
Copy link
Contributor

This was raised internally and while we understand the emoji isn't displayed correctly, this is also a field that will never have an emoji accepted in it. As such we're closing this out for now to focus on bugs with use cases that move use closer to our goals with New Expensify.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
None yet
Development

No branches or pull requests

5 participants