Skip to content

Any whitespace should be trimmed from these places to avoid bugs #4155

Closed

Description

@aman-atg

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

Places where extra whitespace is causing trouble :-

Search Page

  1. search for an email
  2. add extra space
  3. result will disappear

image

Profile Page

  1. Go to profile Page
  2. Edit Firstname and Lastname
  3. Add extra space
  4. Save
  5. Input will be saved as it is. (without trimming the space)

image

Emoji Picker

  1. Login to E.cash
  2. Open any chat
  3. Click the emoji picker
  4. Search for an emoji and add whitespace before or after the search term (Eg. thinking )

Expected Result:

image

Actual Result:

image

Workaround:

Remove whitespace manually

Platform:

Where is this issue occurring?

Web ✔️
iOS ✔️
Android ✔️
Desktop App ✔️
Mobile Web ✔️

Version Number:
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Expensify/Expensify Issue URL:

View all open jobs on Upwork

Activity

  1. added
    AutoAssignerTriage
    on Jul 20, 2021
  2. MelvinBot commented on Jul 20, 2021

    @MelvinBot
    Contributor

    Triggered auto assignment to @trjExpensify (AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.

  3. removed
    AutoAssignerTriage
    on Jul 20, 2021
  4. aman-atg commented on Jul 20, 2021

    @aman-atg
    ContributorAuthor

    Proposal :

    Inside, src/pages/home/report/EmojiPickerMenu/index.js on line 277

    the line :- const normalizedSearchTerm = searchTerm.toLowerCase(); can be changed to
    const normalizedSearchTerm = searchTerm.toLowerCase().trim();
    which will take care of all the whitespaces.

  5. aman-atg commented on Jul 20, 2021

    @aman-atg
    ContributorAuthor

    This proposal can fix #4156 as well

  6. rushatgabhane commented on Jul 21, 2021

    @rushatgabhane
    Member

    @aman-atg I think it'll be a good idea do an audit, and fix it in a combined issue.

  7. aman-atg commented on Jul 21, 2021

    @aman-atg
    ContributorAuthor

    @rushatgabhane Agreed, I'll see where else this issue is occurring and update #4155.

  8. changed the title [-]Any whitespace should be removed while searching for emojies [/-] [+]Any whitespace should be trimmed from these places to avoid bugs[/+] on Jul 21, 2021
  9. aman-atg commented on Jul 21, 2021

    @aman-atg
    ContributorAuthor

    Updated Proposal :

    For Search Page

    this.state.searchValue,

    • should be changed to
      this.state.searchValue.trim(),

    For Profile Page

    const isButtonDisabled = (this.props.myPersonalDetails.firstName === this.state.firstName)
    && (this.props.myPersonalDetails.lastName === this.state.lastName)

    • We can prevent this problem from occurring if isButtonDisabled remains false when only whitespaces are added to either name
    • So, it should be changed into
             const isButtonDisabled = (this.props.myPersonalDetails.firstName === this.state.firstName.trim())
             && (this.props.myPersonalDetails.lastName === this.state.lastName.trim())  

    Finally for Emoji Picker

    const normalizedSearchTerm = searchTerm.toLowerCase();

    • change this to
            const normalizedSearchTerm = searchTerm.toLowerCase().trim();
  10. MelvinBot commented on Jul 22, 2021

    @MelvinBot
    Contributor

    Triggered auto assignment to @johnmlee101 (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

  11. trjExpensify commented on Jul 22, 2021

    @trjExpensify
    Contributor

    I like the idea of an audit and combined issue to clean this up! Assigning to Engineering for review. 👍

  12. 9 remaining items

  13. aman-atg commented on Jul 22, 2021

    @aman-atg
    ContributorAuthor

    Hi @marklouisdeshaun, I've submitted the proposal on upwork.

  14. removed
    Help Wanted
    on Jul 23, 2021
  15. MelvinBot commented on Jul 26, 2021

    @MelvinBot
    Contributor

    @johnmlee101, @aman-atg, @marklouisdeshaun Whoops! This issue is 2 days overdue. Let's get this updated quick!

  16. johnmlee101 commented on Jul 26, 2021

    @johnmlee101
    Contributor

    Just merged the PR

  17. added
    Weekly
    and removed
    Daily
    on Jul 26, 2021
  18. marklouisdeshaun commented on Jul 30, 2021

    @marklouisdeshaun
    Contributor

    Not overdue

  19. marklouisdeshaun commented on Aug 6, 2021

    @marklouisdeshaun
    Contributor

    PR merged

  20. marklouisdeshaun commented on Aug 6, 2021

    @marklouisdeshaun
    Contributor

    Contributor has been paid, the contract has been completed, and the Upwork post has been closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

EngineeringExternalWeekly

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions