In the RichTextEditor, configured with the parameter enterKey: 'BR' when pasting a content with html from another page, the text is displayed wrong in the editor and cannot be edited once pasted. Also, when you get the value of the content with the defaultRTE.value parameter you get an empty string.
Instead, with the enterKey: 'P' parameter this problem does not happen.
To reproduce the problem:
1. open the following example:
2. Open this web page and click on the icon to copy the translated text:
3. Go back to the example editor and paste the content below where it says "Paste below" (Keeping the formatting). The text will be displayed incorrectly (as shown in the following image) and will not be editable.
4. On the other hand, if you try the following example configured with the parameter enterKey: 'P' the content is pasted correctly and can be edited.
This problem also happens if for example you copy from a Gmail mail or other type of content.
Is this a bug?
Copying and pasting from a Word document also causes the same problem.
Attached is a sample Word document.
It shows me access denied to the link.
I have tested and the initial error has been solved, but I have found another error, I detail the steps to follow:
1. Open the following example: https://stackblitz.com/edit/a8qyer-ytt1uo?file=index.html
2. Open the attached Word document, copy all the text.
3. Go back to the example, place the cursor as shown in the image.
4. Paste the copied text (in "Plain text" format).
5. Place the cursor at the end of the text, delete with the Backspace key all the copied text up to where you see the cursor in the following image.
6. Insert two line breaks up to where you see the image.
7. Paste again the text copied from Word (in "Keep" format) -> Nothing is pasted.
Ok, thank you very much!
I have seen that in the last version 20.4.51 the error was fixed according to the release notes, but I have tried with the same example (updating the version files) and the same error still occurs.
The steps to reproduce the error are the same as before.
We couldn't include the fix in the last patch release as we are facing complexity in resolving the issue. We will fix the issue in the upcoming first week of March and let you know once it is included.
We have included the fix for the issue "Pasting from Word doesn't work properly with enterKey 'BR' in RichTextEditor" with our package version 20.4.53. So, can you please upgrade your package to the latest to resolve the issue from your end.