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

How to add undo redo functionality in the editor toolbar? #435

Closed
saran13raj opened this issue Sep 14, 2022 · 1 comment
Closed

How to add undo redo functionality in the editor toolbar? #435

saran13raj opened this issue Sep 14, 2022 · 1 comment

Comments

@saran13raj
Copy link

saran13raj commented Sep 14, 2022

Hi.
I've added 2 buttons in the toolbar for undo and redo. So it acts the same as ctrl+z and ctrl+shift+z in mac.
But not clear how to add functionality for undo and redo in the execute property.
What I need is to call a function that changes the state of the EditorContext without invoking the keyboard shortcuts

@saran13raj
Copy link
Author

I added undo/redo functionality by document.execCommand('undo', false, null).
Even though execCommand is deprecated there's no other alternative at this moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant