Skip to content

Is there any way to fully implement the Undo and Redo functionality? #4781

@leonardo110

Description

@leonardo110

I tried using it in handlers, but I keep getting the error: "Cannot call Quill instance before it's defined." If I use a Vue data variable to store the new Quill instance, I get an error about "offset" mismatch. Who has successfully implemented this? Please share your code!

const quill = new Quill(this.$refs['rich-text-editor'], { modules: { toolbar: { container: this.editorOptions, handlers: { undo: function () { quill.history.undo(); }, redo: function () { quill.history.redo(); } } }, history: { delay: 2000, maxStack: 500, userOnly: true } }, theme: 'snow' });

Below are the imported icons for undo and redo:

.ql-icon[value='undo']::before { content: url('./undo.svg') !important; display: inline-block !important; width: 18px !important; height: 18px !important; } .ql-icon[value='redo']::before { content: url('./redo.svg') !important; display: inline-block !important; width: 18px !important; height: 18px !important; }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions