Open Bug 2017065 Opened 17 hours ago Updated 2 hours ago

Undo history lost in <textarea> after toggling display: none → display: block

Categories

(Core :: DOM: Editor, defect)

Firefox 148
defect

Tracking

()

Webcompat Priority ?

People

(Reporter: me, Unassigned)

References

(Depends on 2 open bugs)

Details

Attachments

(1 file)

Attached file testcase.html

Steps to Reproduce:

  1. Open the attached testcase (or save the HTML below to a file and open it in Firefox).
  2. Type text into the <textarea>.
  3. Make additional edits so undo history exists.
  4. Click the "Hide" button (applies display: none).
  5. Click the "Show" button (restores display: block).
  6. Press Ctrl+Z (Cmd+Z on macOS).

Actual Results:

Undo does nothing. The previous edit history is lost after the element is hidden and shown again.

Expected Results:

Undo history should be preserved when toggling visibility via CSS (display: none -> display: block), since:

  • The DOM node is not removed from the document.
  • The value property remains intact.
  • Other browsers (Chromium-based) preserve undo history in the same scenario.

Note: There are a number of closed bugs about this issue, but I believe it's still in need of a fix, given that the same works fine in Chrome, so it's a webcompat issue. Some of them:

Webcompat Priority: --- → ?
OS: Unspecified → All
Hardware: Unspecified → All
Version: unspecified → Firefox 148
Severity: -- → S3
Depends on: 2016280
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: