Friday, 28 May 2021

QuillJS selection-change caches results for some reason

I have:

    useEffect(() => {
        if (quill) {
            quill.clipboard.dangerouslyPasteHTML(documentContent);
            quill.on('text-change', () => {
                setDocumentContent(quill.root.innerHTML);
            });

            quill.on('selection-change', (range, oldRange, source) => {
                console.log(documentState?.predictionStatus, range, oldRange, source);
            })

        }
    }, [quill]);

But the documentState.predictionStatus stays at it's original value. I think maybe because the value is cached somehow?

Any way to resolve?

Thanks!



from QuillJS selection-change caches results for some reason

No comments:

Post a Comment