svelte-quill icon indicating copy to clipboard operation
svelte-quill copied to clipboard

No way to retrieve quill instance to make native API calls on it?

Open ggaabe opened this issue 4 years ago • 1 comments

I'm new to svelte so maybe I'm missing something, but as far as I can tell, with the svelte implementation being inline within the HTML, there's no way to retrieve the quill instance. Is that correct?

ggaabe avatar Jan 19 '21 02:01 ggaabe

In case somebody has the same issue.

Example in Github readme didn't work for me, I noticed you can get the html element and access hidden __quill property or use Quill directly - which is way nicer.

So I did that:

<script lang="ts">
    import Quill from 'quill/core';

    let quillElement;

    onMount(() => {
        const editorInstance = Quill.find(quillElement);

        editorInstance?.setText(initialText);
    });
</script>


<div class="wysiwyg-container">
    <div bind:this={quillElement}
         use:quill={options}
         on:text-change></div>
</div>
</style>

Eragra3 avatar Mar 11 '23 11:03 Eragra3