Redo does not work after paste and undo
Categories
(Core :: DOM: Editor, defect, P3)
Tracking
()
People
(Reporter: bug-str, Unassigned)
Details
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0
Steps to reproduce:
- Type some text (10-20 characters), do NOT hit "Enter"[!] then
- Paste some text copied from a website or MS Word (i.e. formatted text) - 1 line is sufficient (with or without [CR].
- Ctrl-z to "undo".
Actual results:
Both the text pasted and typed are erased.
Redo is impossible.
Also after "paste" is done (before "Undo"), a [CR] (Newline?) is inserted before the pasted text and the cursor moves to the beginning of the pasted line.
Expected results:
-
Redo should be possible no matter what.
-
I would expect that only the latest action ("Paste") should be "undone", not both typing and pasting. It looks like the program uses "Enter" ([CR]) as an end of action, while I'd expect a different type of input should qualify (That's how it is in all programs I've used, starting with MS Word, PPT)
-
Also there is a different issue (in the synopsis), but I suspect the code responsible is the same. So, I am reporting it here:
After "paste" is done (before doing "Undo"), a [CR] (Newline?) is insterted before the pasted text and the cursor moves to the beginning of the pasted line.
I would expect it to be at the end of the pasted text. And I would not expect that new line inserted if the pasted text doesn't have it.
It looks like that the new formatted string is treated with a newline in front of it. But even if I did hit "Enter" after typing the text (item 1. above), that newline appears - so we get an extra empty line.
Observed on 60.4.0 (32-bit) on Win10.
I see a few old bugs that are sort of relevant but were reported closed. E.g. Bug 261392, Bug 261392.
And there is one similar (albeit much smaller in scope), most likely related, old, but still unassigned Bug 1235454.
Comment 1•7 years ago
|
||
Thunderbird uses the Mozilla core editor also used for Firefox. Can you reproduce this at:
https://www-archive.mozilla.org/editor/midasdemo/
Updated•7 years ago
|
(In reply to Jorg K (GMT+1) from comment #1)
Thunderbird uses the Mozilla core editor also used for Firefox. Can you reproduce this at:
https://www-archive.mozilla.org/editor/midasdemo/
The problem is not present in that online editor.
When I paste the text there (using Ctrl-V, as I do in Thunderbird), - the extra newline (CR?) before the pasted text is not introduced, as in case of Thunderbird. Then, the Undo deletes only the pasted text. So, in that editor it works as expected.
I can confirm this bug. It doesn't happen always, but it's very annoying when you have lost whole e-mail because of undo deleting all text and no way to redo.
still present (thunderbird 68.8.1 with word 2010 french if it matters)
Updated•3 years ago
|
Description
•