-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[AU] Chat - Only a single word is copied when using "Copy to clipboard" on a sentence #53734
Comments
Triggered auto assignment to @CortneyOfstad ( |
Edited by proposal-police: This proposal was edited at 2023-11-01T12:00:00Z. ProposalPlease re-state the problem that we are trying to solve in this issue.In Safari, Copy to clipboard copies only one word instead of the whole message. What is the root cause of that problem?The app checks if the selection is empty. If so, it copies the entire message. Otherwise, it copies only the selected text.
However, the word under the cursor is automatically selected after right-clicking in Safari and Chrome on MacOS. In Safari, the timing is: In Chrome, the timing is: The app accesses the selection in
More info: https://stackoverflow.com/a/71979616. What changes do you think we should make in order to solve the problem?Call const executeSecondaryInteractionOnMouseDown = (event: MouseEvent) => {
if (!onSecondaryInteraction || event.button !== 2) {
return;
}
onSecondaryInteraction(event);
if (withoutFocusOnSecondaryInteraction) {
element.blur();
}
};
const preventDefaultOnContextMenu = (event: MouseEvent) => {
if (!onSecondaryInteraction) {
return;
}
event.stopPropagation();
if (preventDefaultContextMenu) {
event.preventDefault();
}
}; What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?This is related to the behavior of a specifc browser, so automated tests are unlikely to help. Consider adding more manual testing effort on desktop Safari if it’s worth it. What alternative solutions did you explore? (Optional) |
This is not a bug. If you click on a single word to copy, it's only going to copy that single word. If you want the entire sentence to be copied, you need to highlight the entire sentence and then copy. This is working by design, so closing. |
@CortneyOfstad I think the problem is the mismatch between visual cues and the actual result. For example, in Slack and Discord, when right-clicking a word, it’s highlighted with a blue background, so the user expects the word to be copied. In our app, however, right-clicking a word highlights the entire message with a grey background, so the user expects the entire message to be copied. There's also inconsistency between platforms: in Safari, only the word is copied, while in Chrome and native apps, the entire message is copied. |
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: 9.0.72-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/5312619
Issue reported by: Applause Internal Team
Action Performed:
Precondition: Log out
Expected Result:
The full sentence should be copied.
Actual Result:
Only a single word is copied when using "Copy to clipboard" on a sentence.
Workaround:
Unknown
Platforms:
Screenshots/Videos
Bug6686510_1733496747314.Screen_Recording_2024-12-06_At_6.32.13.mp4
View all open jobs on GitHub
The text was updated successfully, but these errors were encountered: