NPM Resource Changed bug PR-5.4-dev Pending

User tests: Successful: Unsuccessful:

avatar dgrammatiko
dgrammatiko
8 Feb 2026

Pull Request resolves #46738

Summary of Changes

  • There's a race condition forcing to constant re rendering of tinyMCE thus making the editor unusable

  • also this patch should make any forms with tinyMCE feels much faster (the interactivity is quicker)

Testing Instructions

  • Follow the issue description and test the editor functionality for all 3 major engines (Chrome, Safari, Firefox)

  • Also create a subform custom field and inside put an editor field. In the article custom field tab create couple (or more) repeatable fields and insert some text and an image. Change the fields order (after reposition a field the editor should have the content it had before moving it around)

Actual result BEFORE applying this Pull Request

Constant rerendering

Expected result AFTER applying this Pull Request

All good

Link to documentations

Please select:

  • Documentation link for guide.joomla.org:

  • No documentation changes for guide.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

@Fedik

e3b1041 8 Feb 2026 avatar dgrammatiko race
avatar dgrammatiko dgrammatiko - open - 8 Feb 2026
avatar dgrammatiko dgrammatiko - change - 8 Feb 2026
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 8 Feb 2026
Category JavaScript Repository NPM Change
avatar dgrammatiko dgrammatiko - change - 8 Feb 2026
Labels Added: NPM Resource Changed PR-5.4-dev
avatar richard67 richard67 - change - 8 Feb 2026
The description was changed
avatar richard67 richard67 - edited - 8 Feb 2026
avatar Fedik
Fedik - comment - 8 Feb 2026

Looks good if it works.
You also can remove editor.on('load', () => {}) and leave only PostRender listener.

c91ee5b 8 Feb 2026 avatar dgrammatiko cs
avatar dgrammatiko dgrammatiko - change - 8 Feb 2026
Labels Added: bug
avatar dgrammatiko
dgrammatiko - comment - 8 Feb 2026

You also can remove editor.on('load', () => {}) and leave only PostRender listener.

This requires testing the repeatable form, so maybe in another PR
Ok done

avatar dgrammatiko dgrammatiko - change - 8 Feb 2026
The description was changed
avatar dgrammatiko dgrammatiko - edited - 8 Feb 2026
avatar Fedik
Fedik - comment - 8 Feb 2026

This requires testing the repeatable form in ANY case ;)

avatar richard67
richard67 - comment - 8 Feb 2026

This requires testing the repeatable form in ANY case ;)

@dgrammatiko Maybe you can add that to the testing instructions? Ah, I just see it is already there.

avatar dgrammatiko
dgrammatiko - comment - 8 Feb 2026

@Fedik I removed completely the debounce choreography and instead I deal with any changes in the iframe directly on the thenable part of the configuration. Seems to be way faster and it works correctly (if my tests are checking the right thing). If you have some time give it a go

avatar Fedik
Fedik - comment - 8 Feb 2026

debounceReInit was need when User change position quickly few times in row, or by dragging.
I do not remember exact details.

Need to test.

avatar OctavianC OctavianC - test_item - 9 Feb 2026 - Tested unsuccessfully
avatar OctavianC
OctavianC - comment - 9 Feb 2026

I have tested this item 🔴 unsuccessfully on 3a584fb

Tested with Firefox Developer 148.0b12 (64-bit) and Firefox 147.0.3 (64-bit)
There is still a constant refresh (now the editor doesn't fully load) - pressing ESC (which probably stops the reloading of the iframe) shows the editor.

On a Chrome engine the editor seems to be working fine.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46852.

avatar OctavianC
OctavianC - comment - 9 Feb 2026

Screenshot before pressing ESC:
image
After pressing ESC:
image

avatar dgrammatiko
dgrammatiko - comment - 9 Feb 2026

@OctavianC what’s your OS?

avatar OctavianC
OctavianC - comment - 9 Feb 2026

Windows 11 Pro

avatar korenevskiy
korenevskiy - comment - 11 Feb 2026

No, it doesn'T help. I turned on developer mode and replaced the contents of the file.
/media/plg_editors_tinymce/js/tinymce.js from the modified PR, the cache is disabled.

This is the call stack for the editor with no changes without this PR

@Fedik I left the debugging breakpoints in the lines below in
the /media/plg_editors_tinymce/js/tinymce file.js
Then when the debugger stopped at these points. I clicked continue tracking. And the mistakes stopped. When I removed the breakpoints from these commands and reloaded the page, the eternal reboot returned. And when I set breakpoints, there is no reboot, the editor started working normally.

 ed.on('load', () => { 
   isReady = true; 
   if (isRendered) { 
     listenIframeReload(); 
   } 
 }); 
  ed.on('PostRender', () => { 
   isRendered = true; 
   if (isReady) { 
     listenIframeReload(); 
   } 
 }); 

If I put a breakpoint on line 206. Then there is a reboot anyway.
in if(isRendered) // isRendered = FALSE

ed.on('load', () => {
        isReady = true;
        if (isRendered) {
          listenIframeReload();
        }
      });

If I put a breakpoint on line 212 and I will continue. Then the reboot Stops.
in if(isReady) // isReady = true

      ed.on('PostRender', () => {
        isRendered = true;
        if (isReady) {
          listenIframeReload();
        }
      });

I noticed something that the size of the browser's memory is constantly growing. If you leave this page for an hour, the browser will devour 6 GB of RAM. I didn't measure it exactly, but the evenings of waiting, the whole RAM was occupied along with the swap file. The PC was fast, but the browser was very dumb. but I could be wrong.
After closing the browser, a lot of memory was released. As a rule, my tabs are always asleep. It is unlikely that another site or extension ate the memory.

This is a tracing of challenges.

setupEditor (https://premiya-nika.ru/media/plg_editors_tinymce/js/tinymce.js?e36a5a#212)
dispatch (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js?8b0100#30008)
dispatch (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js?8b0100#30124)
firePostRender (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js?8b0100#9302)
preInit (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js?8b0100#28599)
contentBodyLoaded (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js?8b0100#28708)
ready (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js?8b0100#28783)
setupIframeBody (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js?8b0100#28790)
init$1 (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js?8b0100#28808)
init (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js?8b0100#28944)
initEditor (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js?8b0100#29032)
loadScripts (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js?8b0100#29040)
render (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js?8b0100#29128)
render (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js?8b0100#30790)
setupEditor (https://premiya-nika.ru/media/plg_editors_tinymce/js/tinymce.js?e36a5a#224)
debounceReInit/reInitQueue[element.id]< (https://premiya-nika.ru/media/plg_editors_tinymce/js/tinymce.js?e36a5a#19)
debounceReInit (https://premiya-nika.ru/media/plg_editors_tinymce/js/tinymce.js?e36a5a#16)
listenIframeReload (https://premiya-nika.ru/media/plg_editors_tinymce/js/tinymce.js?e36a5a#198)
listenIframeReload (https://premiya-nika.ru/media/plg_editors_tinymce/js/tinymce.js?e36a5a#197)
setupEditor (https://premiya-nika.ru/media/plg_editors_tinymce/js/tinymce.js?e36a5a#213)
dispatch (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js?8b0100#30008)
dispatch (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js?8b0100#30124)
firePostRender (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js?8b0100#9302)
preInit (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js?8b0100#28599)
contentBodyLoaded (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js?8b0100#28708)
ready (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js?8b0100#28783)
setupIframeBody (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js?8b0100#28790)
init$1 (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js?8b0100#28808)
init (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js?8b0100#28944)
initEditor (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js?8b0100#29032)
loadScripts (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js?8b0100#29040)
render (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js?8b0100#29128)
render (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js?8b0100#30790)
setupEditor (https://premiya-nika.ru/media/plg_editors_tinymce/js/tinymce.js?e36a5a#224)
debounceReInit/reInitQueue[element.id]< (https://premiya-nika.ru/media/plg_editors_tinymce/js/tinymce.js?e36a5a#19)
debounceReInit (https://premiya-nika.ru/media/plg_editors_tinymce/js/tinymce.js?e36a5a#16)
listenIframeReload (https://premiya-nika.ru/media/plg_editors_tinymce/js/tinymce.js?e36a5a#198)
listenIframeReload (https://premiya-nika.ru/media/plg_editors_tinymce/js/tinymce.js?e36a5a#197)

setupEditor (https://premiya-nika.ru/media/plg_editors_tinymce/js/tinymce.js?e36a5a#213)
dispatch (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js?8b0100#30008)
dispatch (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js?8b0100#30124)
firePostRender (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js?8b0100#9302)
preInit (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js?8b0100#28599)
contentBodyLoaded (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js?8b0100#28708)
ready (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js?8b0100#28783)
setupIframeBody (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js?8b0100#28790)

I hope this is useful information.

avatar dgrammatiko
dgrammatiko - comment - 11 Feb 2026

@korenevskiy with the code from this pr you should have only one listener not both postrender and load, you probably should download the installable and check again

avatar korenevskiy
korenevskiy - comment - 11 Feb 2026

@dgrammatiko You're right.

I'm posting a new routing stack calls for this PR

Now the reboot is also eternal. But the editor's design doesn't even appear in the new PR, i.e. it doesn't render at all.

If I put a breakpoint on line 181, and then continue. That is, there is no error, the editor is working fine.
If I don't put a breakpoint, then the reset of the white space continues indefinitely.

editor.on('PostRender', () => {
        // Check for the load event on iframe
        if (editor.iframeElement) { // this braake point  == "<iframe id="jform_articletext_ifr" class="tox-edit-area__iframe" frameborder="0" allowtransparency="true" title="Rich Text Area">"
          editor.iframeElement.addEventListener('load', () => {
            editor.remove();
            JoomlaEditor.unregister(element.id);
            Joomla.JoomlaTinyMCE.setupEditor(element, pluginOptions);
          });
        }
      });
    setup (https://premiya-nika.ru/media/plg_editors_tinymce/js/tinymce.js#181)
dispatch (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#30008)
dispatch (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#30124)
firePostRender (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#9302)
preInit (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#28599)
contentBodyLoaded (https://premiya-nika.ru/media/vendor/tinymce/tinymce.j?#28708)
ready (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#28783)
setupIframeBody (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#28790)
init$1 (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#28808)
init (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#28944)
initEditor (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#29032)
loadScripts (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#29040)
render (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#29128)
render (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#30790)
createEditor (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#31258)
initEditors (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#31276)
each$c (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#541)
initEditors (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#31272)
executeHandlers (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#4169)
defaultNativeHandler (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#3991)
bindOnReady (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#3953)
bind (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#4038)
bind (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#4825)
init (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#31281)
    setupEditor (https://premiya-nika.ru/media/plg_editors_tinymce/js/tinymce.js#200)
    setup (https://premiya-nika.ru/media/plg_editors_tinymce/js/tinymce.js#185)
    setup (https://premiya-nika.ru/media/plg_editors_tinymce/js/tinymce.js#182)
dispatch (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#30008)
dispatch (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#30124)
firePostRender (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#9302)
preInit (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#28599)
contentBodyLoaded (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#28708)
ready (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#28783)
setupIframeBody (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#28790)
init$1 (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#28808)
init (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#28944)
initEditor (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#29032)
loadScripts (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#29040)
render (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#29128)
render (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#30790)

avatar dgrammatiko
dgrammatiko - comment - 11 Feb 2026

@korenevskiy it's weird that this code works fine on my machine (macOS) but fails on Windows. Could you try the code I just pushed?

avatar korenevskiy
korenevskiy - comment - 11 Feb 2026

@dgrammatiko
The white space of the field

    setup (https://premiya-nika.ru/media/plg_editors_tinymce/js/tinymce.js#181)
dispatch (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#30008)
dispatch (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#30124)
firePostRender (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#9302)
preInit (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#28599)
contentBodyLoaded (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#28708)
ready (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#28783)
setupIframeBody (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#28790)
init$1 (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#28808)
init (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#28944)
initEditor (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#29032)
loadScripts (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#29040)
render (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#29128)
render (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#30790)
createEditor (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#31258)
initEditors (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#31276)
each$c (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#541)
initEditors (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#31272)
bind (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#4044)
bind (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#4825)
init (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#31281)
    setupEditor (https://premiya-nika.ru/media/plg_editors_tinymce/js/tinymce.js#202)
    setup (https://premiya-nika.ru/media/plg_editors_tinymce/js/tinymce.js#187)
    setup (https://premiya-nika.ru/media/plg_editors_tinymce/js/tinymce.js#184)
dispatch (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#30008)
dispatch (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#30124)
firePostRender (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#9302)
preInit (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#28599)
contentBodyLoaded (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#28708)
ready (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#28783)
setupIframeBody (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#28790)
init$1 (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#28808)
init (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#28944)
initEditor (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#29032)
loadScripts (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#29040)
render (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#29128)
render (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#30790)
createEditor (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#31258)
initEditors (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#31276)
each$c (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#541)
initEditors (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#31272)
executeHandlers (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#4169)
defaultNativeHandler (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#3991)
bindOnReady (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#3953)
bind (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#4038)
bind (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#4825)
init (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#31281)
    setupEditor (https://premiya-nika.ru/media/plg_editors_tinymce/js/tinymce.js#202)
    setup (https://premiya-nika.ru/media/plg_editors_tinymce/js/tinymce.js#187)
    setup (https://premiya-nika.ru/media/plg_editors_tinymce/js/tinymce.js#184)
dispatch (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#30008)
dispatch (https://premiya-nika.ru/media/vendor/tinymce/tinymce.js#30124)
avatar korenevskiy
korenevskiy - comment - 11 Feb 2026

I used the stop script check box for a critical error in the Firefox Developer browser.
The error occurs in 16231 lines , of in is file.
/media/vendor/tinymce/tinymce.js

const _forceRemove = function _forceRemove(node) {
        arrayPush(DOMPurify.removed, { element: node });
        try {
          node.parentNode.removeChild(node); // This error. 
        } catch (_) {
          node.remove();
        }
      };

The Node object contains the <BR> tag object. Which have no parent

avatar korenevskiy
korenevskiy - comment - 11 Feb 2026

@dgrammatiko
I'll update the latest changes.
There is a constant reboot and a white space field.
And at the same time, the browser download icon always displays a cross. That is, there is a continuous download. But if I press STOP, i.e. I press the cross, then the editor immediately appears in working condition.

avatar dgrammatiko
dgrammatiko - comment - 12 Feb 2026

@korenevskiy please do one more test here. Thanks

avatar korenevskiy
korenevskiy - comment - 12 Feb 2026

Cool, everything works great. Right. THERE are NO preloads. Works.
👍👍👍👍👍
изображение

avatar korenevskiy
korenevskiy - comment - 12 Feb 2026

@dgrammatiko
It's a personal matter.
How do I initialize TinyMCE using JS, inside an IFRAME?
Have you tried doing this before?
I know what to do tinymce.init('#textareaID');
But it doesn't work inside the IFRAME.
Using JS, I access the Iframe, then access the contents of the Iframe, and by ID I get a textarea object in the iframe, but this textarea object is not perceived by TinyMCE. Have you had any initialization experience?

avatar korenevskiy
korenevskiy - comment - 13 Feb 2026

@dgrammatiko Is this a Firefox Developer bug or just an accident?

avatar muhme
muhme - comment - 13 Feb 2026

Cool, everything works great.

@korenevskiy Could you please report your test results in our Joomla! Issue Tracker?

avatar OctavianC OctavianC - test_item - 13 Feb 2026 - Tested successfully
avatar OctavianC
OctavianC - comment - 13 Feb 2026

I have tested this item ✅ successfully on 4e387db

Tested while editing an article and using multiple editors as Fields in a Subform (drag and drop retains the values of the editors) with:

avatar dgrammatiko dgrammatiko - change - 13 Feb 2026
The description was changed
avatar dgrammatiko dgrammatiko - edited - 13 Feb 2026
avatar muhme muhme - test_item - 13 Feb 2026 - Tested successfully
avatar muhme
muhme - comment - 13 Feb 2026

I have tested this item ✅ successfully on 4e387db

Tested with JBT on current 5.4-dev

  • Seen flashing problem before with Firefox Developer Edition
  • Applied PR and npm run build:js
  • Flashing editor problem is solved in Firefox Developer Edition
  • Tested tinyMCE is working on macOS: Firefox, Chrome and Safari

This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46852.
avatar dgrammatiko dgrammatiko - change - 14 Feb 2026
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2026-02-14 16:14:20
Closed_By dgrammatiko
avatar dgrammatiko dgrammatiko - close - 14 Feb 2026

Add a Comment

Login with GitHub to post a comment