-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Only select message data on triple click #6500
Conversation
@nrayburn-tech Thanks for digging in on this. I played with your selection-changing code a bit, and it does seem to have some problems when the contents of the message is not just text. Links for sure cause weird behavior. Given this message:
Your default triple-click would select the entire thing, but your logic will force the selection to just 'Hey, did you see this?' You'll probably also want to test things like emoji and new formatting (bold, italic, strikethrough, monospace, spoiler). Those all put interesting things into the composer that might change behavior. |
@scottnonnenberg-signal Updated the PR with changes that should be safer. If the triple click creates a selection that includes the metadata, then the selection is modified to be just before the metadata element so that it is excluded. I was able to test your example with a link, but I couldn't figure out how to do custom formatting (bold, italic, strikethrough, etc.) to test it. I think those scenarios should still work with this approach though. When running
|
That error is coming from |
Thanks for all your efforts on this! We've merged it internally, and it will be in the next beta family we release - probably 6.26.x. |
(if you keep this PR open, it will automatically be marked as merged when we push our internal merge commits to a public branch) |
Fixes #6428
First time contributor checklist:
Contributor checklist:
main
branchyarn ready
run passes successfully (more about tests here)Description
I'm not sure if the code should exist somewhere else, if so I can move it.
I'm not sure if triple-clicking is a macOS specific functionality or not. If it is, a check can be added to only enable this change for macOS devices.
Can be tested by opening a conversation and triple-clicking a message. All text up to the next line break in the message should be selected. It can then be copied and pasted with only the message text, the timestamp should not be copied or pasted.
I didn't find any existing tests to go off of for the
Message
component, so I didn't write any new tests.Tested on macOS 13.4.1 (22F82).
triple-click.mov