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

quill.history.undo() not working in typescript #963

Open
8 tasks
NagarwalRahul opened this issue Apr 3, 2024 · 1 comment
Open
8 tasks

quill.history.undo() not working in typescript #963

NagarwalRahul opened this issue Apr 3, 2024 · 1 comment

Comments

@NagarwalRahul
Copy link

Thanks for filing an issue!

If at all possible, please provide a Codesandbox or Codepen to demonstrate the problem you're having with React Quill. Here's a template to get you started.

⚠️ Make sure that your bug hasn't already been fixed by ReactQuill v2.0.0-beta.2. See the homepage for instructions on how to upgrade.

Ticket due diligence

  • I have verified that the issue persists under ReactQuill v2.0.0-beta.2
  • I can't use the beta version for other reasons

ReactQuill version

  • master
  • v2.0.0-beta.2
  • v2.0.0-beta.1
  • 1.3.5
  • 1.3.4 or older
  • Other (fork)

FAQ

Is this a bug in Quill or ReactQuill?

ReactQuill is just a thin wrapper on top of the Quill editor. Often, what looks like a bug in ReactQuill, is actually a bug in the Quill editor itself. Before opening a ticket, please check the Quill documentation, and the issues page, and see if that answers your question first.

How do I access the wrapped Quill instance?

See the instance methods and API documentation.

@peterwb
Copy link

peterwb commented May 2, 2024

Here is how I got it working with Typescript. Here is my Codesandbox: https://codesandbox.io/p/sandbox/react-quill-typescript-undo-redo-sjs6v4

`

    let quillEditor: any;

    handlers: {
      undo: () => {
        return quillEditor?.history.undo();
      },
      redo: () => {
        return quillEditor?.history.redo();
      },
    },


   <ReactQuill
      ref={(el) => {
        if (el) quillEditor = el.getEditor();
      }}
      theme="snow"
      modules={quillModules}
      value={note_text}
      onChange={(html, delta, source, editor) => {
        setNoteText(html);
      }}
    />`

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

2 participants