Undo menu broken when deleting text with keyboard in a content editable zone.



2 years ago
8 days ago


(Reporter: rhubscher, Unassigned)


(Depends on: 1 bug)


Firefox Tracking Flags

(firefox54 affected, firefox56 affected)


(Whiteboard: [needscontact], URL)



2 years ago
Removing a text with the Delete key in a content editable zone and then trying to Undo with the right click menu doesn't work.

[Step to reproduce]
1. Access https://quilljs.com/playground/
2. Type some text inside
3. Select and remove with your keyboard (either Delete or Backspace)
4. Right click and select the Undo menu.

[Expected behavior]

The deleted text is back on the text area

[Actual behavior]

The Undo menu has no action.

Refs https://github.com/mozilla/notes/issues/114

Comment 1

2 years ago
Did this use to work (ie is this a regression) ?
Component: General → Untriaged
Flags: needinfo?(rhubscher)
Component: Untriaged → Editor
Product: Firefox → Core

Comment 2

2 years ago
I have no idea, it appears to work fine in a textarea though.

Refs: https://github.com/mozilla/notes/issues/114
Flags: needinfo?(rhubscher)

Comment 3

2 years ago
UA spoofing seems to fix the problem on Windows10 Nightly56.0a1.
i.e, seting general.useragent.override = "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36"
Great thanks, Alice-san.

At least, since this doesn't work on Firefox 54, I don't think that this is recently regression.  We might have to investigate this why this doesn't work.
status-firefox54: --- → affected
status-firefox56: --- → affected

Comment 5

2 years ago
Error in Browser console:
IndexSizeError: Component returned failure code: 0x80530001 [nsIDocShell.doCommand]  browser-child.js:401
This is site issue.  This editor manages undo transaction by self, not Gecko.  So when using [Ctrl] + [Z], it is handled by javascript, not our transaction manager.

But context menu uses Gecko's transaction manager.  So it doesn't work. (since delete selection isn't into undo stack)

contenteditable cannot turn off undo stack from javascript, if https://github.com/w3c/editing/issues/150 is resolved, undo menu can be turned off.
Priority: -- → P5
This is site bug and there is no spec to turn off undo stack of browser.

If delete selection (step. 3) is handled by browser, undo will work.  But step. 3 is handled by site's JS unfortunately.  So this operation isn't added into our undo stack.
Component: Editor → Desktop
Product: Core → Tech Evangelism
Depends on: 970802
Whiteboard: [needscontact]
Component: Desktop → Desktop
Product: Tech Evangelism → Web Compatibility
You need to log in before you can comment on or make changes to this bug.