tinymce / tinymce-svelte

Svelte wrapper
MIT License
23 stars 6 forks source link

Can two inline <Editor> components live in same <form>? #30

Closed dmccallie closed 1 year ago

dmccallie commented 1 year ago

HI, I'm using locally hosted tinymce version 6 in Sveltekit, using the tinymce <Editor> component that you have created.

I am using it with "inline" mode, and would like to have several fields in my form leverage the nice pop-up editor toolbar that inline mode enables.

The only way I've been able to make inline work with Svelte is to put the <Editor> component inside a <div> with a "hidden" attribute. Then have another <div> with the class equal to the conf.selector value. The non-hidden <div> nicely triggers the pop-up toolbar, and captures the content as I type. So far, so good.

This works fine when I have only one instance of the hidden <Editor> in my form, but when I add a second hidden instance, the value returned from the editors get mixed up. In particular, whatever I type into the second instance shows up as the{value} of the first instance. The behavior seems inconsistent, because sometimes it seems to work ??

FWIW, I can successfully host two <Editor> instances in the same <form> when using non-inline mode, but not when inline.

So my question - should I be able to host two inline <Editor> instances in the same svelte

? (Perhaps using a hidden div for the is the wrong way to set up for inline mode?)

Thanks!

exalate-issue-sync[bot] commented 1 year ago

Ref: INT-3090

jscasca commented 1 year ago

You should be able to host multiple instances of the inline editor in the same form. I would need to see a replication in which this doesn't work to further investigate.

In the mean time I will close the ticket but happy to reopen with a replication