matrix-react-sdk
matrix-react-sdk copied to clipboard
Copy events from the timeline in an IRC log style format
rather than as incoherent gunks of HTML and text, which ends up including avatars and RRs and context menus and all sorts.
It's debatable as to whether this is the right approach: we go and walk the displayed DOM, putting the innerHTML/innerText of the event contents into a new wrapper built from the event's metadata.
Instead, we could make EventTile support rendering to a logger mode, which would then help us finally fix https://github.com/vector-im/riot-web/issues/2630. However, this means that we would be completely rebuilding the clipboard rather than basing it on what the user actually copied (and for instance, it would be much harder to handle partial event selections).
This solution could always evolve in that direction in future though.
thoughts welcome.
rather than as incoherent gunks of HTML and text, which ends up including avatars and RRs and context menus and all sorts.
Is this actually happening for you today? We've tried to prevent this somewhat by setting user-select: none on things that generally shouldn't be copied.
Aha, after some testing, it appears Firefox does listen to this CSS when copying, but Chrome does not. 😕
Related issues:
- https://github.com/vector-im/element-web/issues/893
- https://github.com/vector-im/element-web/issues/17844
- https://github.com/vector-im/element-web/issues/11673
- https://github.com/vector-im/element-web/issues/11525
- https://github.com/vector-im/element-web/issues/18202
- slightly related, https://github.com/vector-im/element-web/issues/10649
Testing, it seems the behaviour here is sensible now so I think this PR is no longer necessary.