React-quill: How to turn off spellcheck?

Created on 25 Jul 2018  路  5Comments  路  Source: zenoamaro/react-quill

Most helpful comment

FYI:

function MyEditor() {
  const quillRef = useRef(null);

  const handleRef = useCallback((ref) => {
    const quill = ref.getEditor();

    // disable spellcheck
    quill.root.setAttribute('spellcheck', false);

    quillRef.current = ref;
  }, []);

  return <ReactQuill ref={handleRef} />;
}

All 5 comments

This does not appear to be a feature of Quill: https://quilljs.com/docs/configuration/

Any workaround? There seems to be some workarounds for vanilla Quill, see https://github.com/quilljs/quill/issues/2225

FYI:

function MyEditor() {
  const quillRef = useRef(null);

  const handleRef = useCallback((ref) => {
    const quill = ref.getEditor();

    // disable spellcheck
    quill.root.setAttribute('spellcheck', false);

    quillRef.current = ref;
  }, []);

  return <ReactQuill ref={handleRef} />;
}

FYI:

function MyEditor() {
  const quillRef = useRef(null);

  const handleRef = useCallback((ref) => {
    const quill = ref.getEditor();

    // disable spellcheck
    quill.root.setAttribute('spellcheck', false);

    quillRef.current = ref;
  }, []);

  return <ReactQuill ref={handleRef} />;
}

Its work for me!

@nzwsch what is the use useRef doing in your solution? It appears that hook is unneeded ?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mtando picture mtando  路  5Comments

alexkrolick picture alexkrolick  路  4Comments

Fensterbank picture Fensterbank  路  3Comments

jaimefps picture jaimefps  路  3Comments

stinoga picture stinoga  路  3Comments