App icon indicating copy to clipboard operation
App copied to clipboard

[$250] Firefox - Chat- Intended comment not copied to clipboard after highlighting a part of the text and selecting another message reported by @daraksha-dk

Open kavimuru opened this issue 2 years ago • 10 comments

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:

  1. Go to any chat
  2. Select a part of any message
  3. Open the context menu for any message
  4. Select "Copy to Clipboard" option
  5. the selected part in 2nd step will be copied instead of the message on 3rd step

Expected Result:

the whole message should get copied for which the context menu was open

Actual Result : Only the initial selected text is getting copied

Workaround:

unknown

Platform:

Where is this issue occurring?

  • Web - Firefox only

Version Number: 1.2.24-1 Reproducible in staging?: y Reproducible in production?: y Email or phone of affected tester (no customers): Logs: https://stackoverflow.com/c/expensify/questions/4856 Notes/Photos/Videos:

https://user-images.githubusercontent.com/43996225/200364117-b7abebd7-abe6-446f-b405-651e04702d84.mp4

https://user-images.githubusercontent.com/43996225/200364171-f4e60499-3ea1-4fa8-9332-d29ff11f69ca.mp4

Expensify/Expensify Issue URL: Issue reported by: @daraksha-dk Slack conversation: https://expensify.slack.com/archives/C01GTK53T8Q/p1667833739312529

View all open jobs on GitHub

kavimuru avatar Nov 07 '22 16:11 kavimuru

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

melvin-bot[bot] avatar Nov 07 '22 16:11 melvin-bot[bot]

I am having trouble reproducing this, so asking here

NicMendonca avatar Nov 07 '22 20:11 NicMendonca

Current assignee @NicMendonca is eligible for the External assigner, not assigning anyone new.

melvin-bot[bot] avatar Nov 08 '22 13:11 melvin-bot[bot]

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

melvin-bot[bot] avatar Nov 08 '22 13:11 melvin-bot[bot]

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

melvin-bot[bot] avatar Nov 08 '22 13:11 melvin-bot[bot]

Job posting: https://www.upwork.com/jobs/~01062c3d4a49229c53

NicMendonca avatar Nov 08 '22 13:11 NicMendonca

Proposal

--- a/src/pages/home/report/ReportActionItem.js
+++ b/src/pages/home/report/ReportActionItem.js
@@ -107,6 +107,13 @@ class ReportActionItem extends Component {
         if (this.props.draftMessage) {
             return;
         }
+
+        const windowSelection = window.getSelection();
+        if (!event.target.contains(windowSelection.focusNode)) {
+            windowSelection.selectAllChildren(event.target);
+            windowSelection.removeAllRanges();
+        }
+
         const selection = SelectionScraper.getCurrentSelection();
         ReportActionContextMenu.showContextMenu(
             ContextMenuActions.CONTEXT_MENU_TYPES.REPORT_ACTION,

Pros & Cons

Pros:

  • Fix the issue
  • Identical behaviour on all browsers

Cons: (maybe Pros2?)

  • The selected text will be deselected (currently in FF it's already being deselected due to a bug #12521) IMHO, I think this is a desired behaviour as keeping the text1 highlighted and copying text2 is confusing

https://user-images.githubusercontent.com/16493223/200625035-cfa76400-92cd-4035-9604-9710d1bb8290.mp4

s77rt avatar Nov 08 '22 16:11 s77rt

I am about to go OOO for a week, so re-assigning.

NicMendonca avatar Nov 09 '22 22:11 NicMendonca

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

melvin-bot[bot] avatar Nov 09 '22 22:11 melvin-bot[bot]

I think this should be set on hold in favour of #12521

s77rt avatar Nov 12 '22 11:11 s77rt

@tgolen @s77rt @Santhosh-Sellavel The other issue is moving along nicely - any reason why this one can't be closed?

slafortune avatar Nov 23 '22 17:11 slafortune

@slafortune Not the same issue. I though fixing the first issue will fix this as well but does not seem like it

s77rt avatar Nov 23 '22 17:11 s77rt

AFAIK we said we would not be focusing on supporting firefox, so I think we should close this issue.

iwiznia avatar Nov 25 '22 12:11 iwiznia

Ah - agreed! https://expensify.slack.com/archives/C01GTK53T8Q/p1668730285445209

slafortune avatar Nov 28 '22 19:11 slafortune