Skip to content

TinyMCE Infinite Loop on Joomla 5 Frontend Edit -- Diagnosis and Fix

More
3 weeks 50 minutes ago #830 by admin
If you've enabled frontend article editing in Joomla 5 and the page freezes, the editor flickers, or your browser tab crashes -- you've hit the TinyMCE reInit loop. This is a confirmed Joomla 5 bug with no upstream fix.

Symptoms
  • Frontend edit page (com_content edit layout) loads but the editor area flickers
  • The TinyMCE toolbar appears, disappears, reappears in a loop
  • Browser CPU spikes to 100%
  • Console shows repeated TinyMCE init/destroy cycles
  • The page eventually becomes unresponsive
  • Admin backend editing works perfectly fine

Root Cause

Joomla 5's TinyMCE plugin has toolbar_sticky: true set by default. On the frontend, this causes a chain reaction:

1. TinyMCE initializes and relocates the toolbar DOM node (sticky behavior)
2. This triggers the iframe's load event
3. Joomla's debounceReInit() function detects the DOM change
4. It destroys the editor and recreates it (500ms debounce)
5. The new editor instance relocates the toolbar again
6. Go to step 2. Infinite loop.

This only happens on the frontend because the admin uses a different page structure where the sticky toolbar relocation doesn't trigger the iframe load event.

Why CSS/JS Fixes Don't Work

You might think you can fix this by:
  • Overriding toolbar_sticky to false via CSS -- but TinyMCE reads the config value, not the CSS
  • Intercepting the reInit function -- but Joomla 5 loads TinyMCE as ES modules with import maps, making interception nearly impossible
  • Adding a MutationObserver to block the destroy -- but the destroy happens inside TinyMCE's own scope

We tested every approach. None survive Joomla's ES module loader.

The Fix

Use JCE (Joomla Content Editor) instead of TinyMCE for frontend editing.

JCE works perfectly on frontend edit pages with zero modifications. Install it, set it as the default editor in Global Configuration, and the infinite loop problem goes away completely.

If you need to keep TinyMCE for the admin backend but use JCE on the frontend, you can set the editor per user group in the user profile options.

Important JCE setup note: If you create a custom JCE profile, the rows field must not be empty -- empty rows = blank toolbar. Copy the toolbar configuration from the Default profile (ID 1) and remove unwanted plugins.

[hr]
This is one of 65+ gotchas documented in The AI Joomla Blueprint -- theaidirector.win

Please Log in or Create an account to join the conversation.

Time to create page: 0.191 seconds

The AI Director

Enjoy Building Joomla Sites with AI

The most enjoyable way to build a Joomla site. Open it in VS Code → — describe what you want, Claude Code → reads the briefing, runs the stack, writes the code. You just keep the conversation going.

A new paradigm.

Browse the Shop →
Built & designed by Weblio Sites from 9 900 NOK — built to outperform

This site was designed and built by Weblio — a Norwegian web agency specialising in fast, professional websites and AI-powered tools for businesses that want to move faster than their competition. Direct communication, honest pricing, no surprises.

Visit Weblio.no →