Skip to content

[$500] Android - Rooms can be created when the user presses the Return key while typing in the description #36624

Closed

Description

@kbecciv

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


Version Number: 1.4.42.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:

Action Performed:

  1. Launch the app
  2. Log in with your account
  3. Tap on Plus green button
  4. Select Start Chat - Room
  5. Enter room name
  6. On description, use any text and hit Return key on Samsung device

Expected Result:

Room should not be created

Actual Result:

Rooms can be created when the user presses the Return key while typing in the description

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

Screen_Recording_20240215_131957_New.Expensify.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01fe10c08e956825df
  • Upwork Job ID: 1758204974898151424
  • Last Price Increase: 2024-03-14

Activity

  1. added
    ExternalAdded to denote the issue can be worked on by a contributor
    BugSomething is broken. Auto assigns a BugZero manager.
    on Feb 15, 2024
  2. changed the title [-]Android - Rooms can be created when the user presses the Return key while typing in the description[/-] [+][$500] Android - Rooms can be created when the user presses the Return key while typing in the description[/+] on Feb 15, 2024
  3. melvin-bot commented on Feb 15, 2024

    @melvin-bot
  4. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Feb 15, 2024
  5. melvin-bot commented on Feb 15, 2024

    @melvin-bot

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

  6. melvin-bot commented on Feb 15, 2024

    @melvin-bot

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

  7. kbecciv commented on Feb 15, 2024

    @kbecciv
    Author

    We think that this bug might be related to #vip-vsb
    CC @quinthar

  8. neonbhai commented on Feb 15, 2024

    @neonbhai
    Contributor

    Proposal

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

    Rooms can be created when the user presses the Return key while typing in the description

    What is the root cause of that problem?

    We don't disable pressing the submit button on enter here

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

    We should change disable press on enter to true

    Alternatively

    We can remove the prop

  9. eucool commented on Feb 15, 2024

    @eucool
    Contributor

    Proposal

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

    Rooms can be created when the user presses the Return key while typing in the description

    What is the root cause of that problem?

    We do not define the type of functionality for enter button for the description InputWrapper:

    <InputWrapper
    InputComponent={TextInput}
    inputID={INPUT_IDS.REPORT_DESCRIPTION}
    label={translate('reportDescriptionPage.roomDescriptionOptional')}
    accessibilityLabel={translate('reportDescriptionPage.roomDescriptionOptional')}
    role={CONST.ACCESSIBILITY_ROLE.TEXT}
    autoGrowHeight
    maxLength={CONST.REPORT_DESCRIPTION.MAX_LENGTH}
    autoCapitalize="none"
    containerStyles={[styles.autoGrowHeightMultilineInput]}
    />

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

    pass a default prop (React documentation) returnKeyType and set it to done:

    <InputWrapper 
         InputComponent={TextInput} 
         inputID={INPUT_IDS.REPORT_DESCRIPTION} 
         returnKeyType='done'

    What alternative solutions did you explore? (Optional)

    N/A

  10. Krishna2323 commented on Feb 15, 2024

    @Krishna2323
    Contributor

    Proposal

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

    Rooms can be created when the user presses the Return key while typing in the description

    What is the root cause of that problem?

    The issue seems device specific, not reproducible on emulator, but I believe it can be solved if we pass the props below conditionally.

    disablePressOnEnter={false}

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

    We should pass false if DeviceCapabilities.canUseTouchScreen() && isMediumScreenWidth is true.

    disablePressOnEnter={DeviceCapabilities.canUseTouchScreen() && isMediumScreenWidth}

    Additionally we can also check for platform !== 'android'.

    Result

  11. agent3bood commented on Feb 18, 2024

    @agent3bood
    Contributor

    Proposal

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

    Android - Rooms can be created when the user presses the Return key while typing in the description

    What is the root cause of that problem?

    The component tha listens for Enter keyboard shortcut is not able to detect the description field as multiline.
    Look here
    while the web implementation for validateSubmitShortcut is skipping this event when `eventTarget.nodeName === 'TEXTAREA'
    the native implementation does not have any information of the event or what type of element is focused.

    To know which input is focus we can use FormContext to store that info.

    <InputWrapper
      InputComponent={TextInput}
      inputID={INPUT_IDS.REPORT_DESCRIPTION}
      onTouched={} // here
      onBlur={} // here
    

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

    Update KeyboardShortcutComponent and add new arg isMultiline
    and use that in the validateSubmitShortcut function.

    Because the keyboardShortcutComponent is only used locally this change will not break other parts of the app, and it will be the expected behaviour to not submit the form when the user presses Enter while typing in a multiline field.

    What alternative solutions did you explore? (Optional)

    • Check if bindHandlerToKeydownEvent emit any useful information when the enter key is pressed on native, the event was just undefined.
    • Tyr to get the focused node and figure out if it is a multiline field, but native do not support focus.
  12. 25 remaining items

  13. mananjadhav commented on Mar 10, 2024

    @mananjadhav
    Collaborator

    @kevinksullivan I am a little lost here on the expected behavior. Based on @ishpaul777's comment it was done intentionally? Are we looking to rollback the change or only fix for Android?

    @kevinksullivan Can you please confirm the expected behavior?

  14. melvin-bot commented on Mar 13, 2024

    @melvin-bot

    @mananjadhav, @kevinksullivan Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  15. melvin-bot commented on Mar 14, 2024

    @melvin-bot

    📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

  16. melvin-bot commented on Mar 14, 2024

    @melvin-bot

    @mananjadhav @kevinksullivan this issue is now 4 weeks old and preventing us from maintaining WAQ, can you:

    • Decide whether any proposals currently meet our guidelines and can be approved as-is today
    • If no proposals meet that standard, please take this issue internal and treat it as one of your highest priorities
    • If you have any questions, don't hesitate to start a discussion in #expensify-open-source

    Thanks!

  17. added
    InternalRequires API changes or must be handled by Expensify staff
    and removed
    ExternalAdded to denote the issue can be worked on by a contributor
    Help WantedApply this label when an issue is open to proposals by contributors
    on Mar 14, 2024
  18. melvin-bot commented on Mar 14, 2024

    @melvin-bot

    Current assignee @mananjadhav is eligible for the Internal assigner, not assigning anyone new.

  19. melvin-bot commented on Mar 15, 2024

    @melvin-bot

    @mananjadhav, @kevinksullivan Huh... This is 4 days overdue. Who can take care of this?

  20. kevinksullivan commented on Mar 15, 2024

    @kevinksullivan
    Contributor

    Huh, closing out if this was by design. @kbecciv was there a particular test you ran where it suggested this was a bug?

  21. kbecciv commented on Mar 19, 2024

    @kbecciv
    Author

    @kevinksullivan No particular test, exploratory issue!

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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2EngineeringInternalRequires API changes or must be handled by Expensify staff

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions