Skip to content

[HOLD for payment 2024-10-17] [$500] Chat - Edit composer is focused even if emoji picker is open #27612

Closed

Description

@lanitochka17

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:

  1. Open any report
  2. Open edit composer for 2 messages
  3. Open emoji picker for first one
  4. Open emoji picker of second one without closing previous message emoji picker

Expected Result:

Edit Composer should not be focused if emoji picker is displayed

Actual Result:

Edit Composer is focused if emoji picker is displayed

Workaround:

Unknown

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • Windows / Chrome

Version Number: 1.3.70-5

Reproducible in staging?: Yes

Reproducible in production?: Yes

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

Monosnap.screencast.2023-09-16.12-41-08.mp4
Recording.35.2.mp4

Expensify/Expensify Issue URL:

Issue reported by: @Krishna2323)

Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1694848738372809

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~016c6dc7febe9f77e8
  • Upwork Job ID: 1703183624812048384
  • Last Price Increase: 2024-09-25
Issue OwnerCurrent Issue Owner: @johncschuster

Activity

  1. added
    External
    Daily
    Bug
    on Sep 16, 2023
  2. changed the title [-]Chat - Edit composer is focused even if emoji picker is open[/-] [+][$500] Chat - Edit composer is focused even if emoji picker is open[/+] on Sep 16, 2023
  3. melvin-bot commented on Sep 16, 2023

    @melvin-bot
  4. melvin-bot commented on Sep 16, 2023

    @melvin-bot

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

  5. added
    Help Wanted
    on Sep 16, 2023
  6. melvin-bot commented on Sep 16, 2023

    @melvin-bot

    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
  7. melvin-bot commented on Sep 16, 2023

    @melvin-bot

    Triggered auto assignment to @sakluger (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

  8. melvin-bot commented on Sep 16, 2023

    @melvin-bot

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

  9. Krishna2323 commented on Sep 16, 2023

    @Krishna2323
    Contributor

    Proposal

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

    Chat - Edit composer is focused even if emoji picker is open

    What is the root cause of that problem?

    In the code, when the emoji picker hides, it directly sets the composer to be focused without checking if the emoji picker is currently visible.

    onModalHide={() => {
    setIsFocused(true);
    focus(true);
    }}

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

    We need to add a check for isEmojiPickerVisible before focusing on the composer.

    Updated code:

    onModalHide={() => {
        InteractionManager.runAfterInteractions(() => {
            if (EmojiPickerAction.isEmojiPickerVisible() || ['TEXTAREA', 'INPUT'].includes(DomUtils.getActiveElement().nodeName)) {
                return;
            }
            setIsFocused(true);
            focus(true);
        });
    }}
    

    Result

    fixed.mp4
  10. tanerochris commented on Sep 17, 2023

    @tanerochris

    Proposal

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

    Report Edit Message composer remains focused when emoji picker remains open.

    What is the root cause of that problem?

    The issue stems from the fact that closing the emoji picker sets the isFocused state to true, this remains true when opening the emoji picker of another edit box.
    https://github.com/Expensify/App/blob/c77814fd5e643cba78e8c8294370d78f633a59c5/src/pages/home/report/ReportActionItemMessageEdit.js#L411C1-L414C31

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

    Set isFocusedRef.current to false if not it is not the active edit message box. Also to ensure that after selecting an emoji the current edit box becomes focused, we add focus(true) at the end of the addEmojiToTextBox handler.

    onModalHide={() => {
    
      if (!isFocusedRef.current) {
        setIsFocused(false)
      }
    
      else {
        setIsFocused(true);
        focus(true);
      }
    
    }}
    
    const addEmojiToTextBox = (emoji) => {
            setSelection((prevSelection) => ({
                start: prevSelection.start + emoji.length + CONST.SPACE_LENGTH,
                end: prevSelection.start + emoji.length + CONST.SPACE_LENGTH,
            }));
            updateDraft(ComposerUtils.insertText(draft, selection, `${emoji} `));
            focus(true)
        };
    
  11. 180 remaining items

  12. s77rt commented on Oct 15, 2024

    @s77rt
    Member
  13. added
    Daily
    and removed
    Weekly
    on Oct 17, 2024
  14. melvin-bot commented on Oct 17, 2024

    @melvin-bot

    Payment Summary

    Upwork Job

    BugZero Checklist (@johncschuster)

    • I have verified the correct assignees and roles are listed above and updated the neccesary manual offers
    • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/1703183624812048384/hired)
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  15. eVoloshchak commented on Oct 20, 2024

    @eVoloshchak
    Contributor

    @johncschuster, should this be $500 or $250? The issue was originally $500 and I don't see any price changes, but that was set a long time ago

  16. johncschuster commented on Oct 22, 2024

    @johncschuster
    Contributor

    Thanks for asking, @eVoloshchak! Let me chat with the team quickly about that. I'll be back shortly!

  17. johncschuster commented on Oct 22, 2024

    @johncschuster
    Contributor

    Looking through our internal documentation, I believe we should keep this at $500 since that was the agreed-upon price, and we have not discussed altering it during the lifespan of this issue.

    (I updated this comment to reflect $500)

  18. johncschuster commented on Oct 22, 2024

    @johncschuster
    Contributor

    Payment Summary

    Contributor+: @eVoloshchak due $500 via NewDot
    Contributor: @s77rt due $500 via NewDot

  19. JmillsExpensify commented on Oct 23, 2024

    @JmillsExpensify
    Contributor

    $500 approved for @eVoloshchak

  20. JmillsExpensify commented on Oct 23, 2024

    @JmillsExpensify
    Contributor

    $500 approved for @s77rt

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

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternal

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions