Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undo doesn't apply to menu operations #168

Open
dmntswntrs opened this issue Aug 26, 2019 · 3 comments
Open

Undo doesn't apply to menu operations #168

dmntswntrs opened this issue Aug 26, 2019 · 3 comments
Labels
out of scope Not planned to be fixed or implemented

Comments

@dmntswntrs
Copy link

After applying an operation from the icon menu that pops up when a block receives focus, if you attempt to undo using CTRL + Z, the operation is not undone.

@jenstroeger
Copy link
Collaborator

@dmntswntrs, I noticed the same in my own instance of editable. I’ve played around a bit and it looks like undo works for as long as you type new text and undo. If you delete text, undo creates a selection of the first undone character only and then stops. Undoing formatting (e.g. making text bold and undoing that) doesn’t seem to work either.

@peyerluk
Copy link
Member

The issue is that the undo of the browser gets disrupted whenever we change the HTML inside a contenteditable. And due to the still poor state of contenteditable implementations across browsers this is surprisingly hard to fix.

At this moment this is out of scope of editable.js unless someone wants to give it a go.

(fyi: At Livingdocs we have solved the undo functionality outside of contenteditable)

@peyerluk peyerluk added the out of scope Not planned to be fixed or implemented label Oct 28, 2020
@jenstroeger
Copy link
Collaborator

@peyerluk, thanks! I previously used a simplistic approach that continuously snapshotted the content (similar to your extractContent() function) of a contenteditable. That felt tedious, though, and I’ve never bothered to refine the approach or to look for better alternatives… 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
out of scope Not planned to be fixed or implemented
Projects
None yet
Development

No branches or pull requests

3 participants