-
Notifications
You must be signed in to change notification settings - Fork 258
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
Turbo + TinyMCE — doesn't reinit the editor after a Turbo interaction #308
Comments
Ok, what's going on here is a little tricky, important to grok before moving forward: To do this, here's what I've done I am using a JSBundling app with the Sprockets pipeline, so my
Then I have a file
(As this is all global code, you can easily put it into the Please note that the above code works with page re-renders and frame renders, I have not tested stream renders. After this fix, TinyMCE re-initializes appropriately between Turbo interactions |
As a sidenote: with Turbo, you really need to put the Javascript in the |
I just took the initialization code and put it into a stimulus controller connect() method, and added the tinymce.remove(); at the beginning. This forces a reload whenever the stimulus controller is loaded, only in pages that use it. |
I am doing something like the below. Seems to work, but there is some 2-3 sec loading delay once in a while when navigate away from the page that has editor.
|
Thanks @jasonfb the fix worked for me |
Hello! Do we have to solve this problem? |
yes @braulio the fix above works |
I tested it and it didn't work. Could you send me a complete example, as nothing I've done has worked. |
Symptom:
Although TinyMCE inits once after a page load, if you make a Tubro interaction (either a whole page render or a frame replacement), the TinyMCE widget does not reinitialize to the textarea after your first Turbo interaction.
Note: there are various suggestions on setting up TinyMCE, but I have the most basic in my
<head>
Then you of course attach class
tinymce
to your textareas. This works for the 1st pickup, but after navigating with Turbo interactions, TinyMCE stops working.The text was updated successfully, but these errors were encountered: