You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I paste text from an application like Microsoft Word, the clipboardData types will include "text/plain", "text/html", "text/rtf" and "Files". The Trix editor will show the text in bold after pasting.
If I paste text from a plain text editor like TextEdit, the clipboardData types will only include "text/plain". We'll get into the special pasteEventHasPlainTextOnly handling. The Trix editor won't show the text in bold after pasting. It will switch the pasted content to bold if you type another character into the editor which seems to indicate that this special handling isn't correctly refreshing the editor after the trix-paste event is done.
Unfortunately, I don't think there's a clean way to work around this other than to serve a customized version of the Trix JavaScript where the Trix.controllers.Level2InputController.events.paste function has been adjusted. It would be nice if #1107 were reviewed.
Say I create a paste handler that is going to change the incoming text like:
If I paste text from an application like Microsoft Word, the
clipboardData
types will include "text/plain", "text/html", "text/rtf" and "Files". The Trix editor will show the text in bold after pasting.If I paste text from a plain text editor like TextEdit, the
clipboardData
types will only include "text/plain". We'll get into the specialpasteEventHasPlainTextOnly
handling. The Trix editor won't show the text in bold after pasting. It will switch the pasted content to bold if you type another character into the editor which seems to indicate that this special handling isn't correctly refreshing the editor after thetrix-paste
event is done.This doesn't affect Trix version 1.3.1 that is running at https://trix-editor.org/.
Do we still need the workaround that was added back in 2019 here? The code comment near the
pasteEventHasPlainTextOnly
handling says:The Chromium bug report is now marked as fixed. Can the workaround be removed now since it's breaking the paste behavior for plain text editors?
Details
The text was updated successfully, but these errors were encountered: