Open Bug 1796776 Opened 3 years ago Updated 3 years ago

Undo in textarea or input type=text captures too much (mostly all text entered)

Categories

(Core :: DOM: Editor, enhancement)

Firefox 106
enhancement

Tracking

()

UNCONFIRMED

People

(Reporter: benjamin, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:106.0) Gecko/20100101 Firefox/106.0

Steps to reproduce:

I'm going to file this as a bug report. It may well be argued that the current "undo/redo" implementation does what it's supposed to, but I'm not familiar with a reference as to why the current behavior is nice, nor an enhancement proposal to improve it.

  • Type in a lot of text in a textfield and press CTRL+Z (undo)

Actual results:

  • When pressing CTRL+z in a textarea, notice that all the entered text disappears (are there exceptions to this?)

Exceptions to "undo=remove all":

  • If you move around the blinking cursor while typing, you can observe that undo segments into two "groups" or undoable events.

Expected results:

  • A single character or word disappears. Holding down CTRL+Z can undo several smaller events in sequence and CTRL+SHIFT+Z can redo them.

You can also observe how Chrome works - it segments undoable actions by roughly each word entered.

I'm on Ubuntu, not sure if implementation for Windows or Mac is different. I also observe that undo functions on top of JavaScript-based richtext fields are buggy: Because of the huge undo history in Firefox, redoing easily becomes impossible and entire text segments can get lost (when your text authoring method is to undo, copy and redo).

Component: Untriaged → DOM: Editor
Product: Firefox → Core
You need to log in before you can comment on or make changes to this bug.