?
avatar infograf768
infograf768
22 Apr 2021

Steps to reproduce the issue

Select CodeMirror as default editor.
Create an article.

Actual result

whattheheck_codemirror

avatar infograf768 infograf768 - open - 22 Apr 2021
avatar joomla-cms-bot joomla-cms-bot - change - 22 Apr 2021
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 22 Apr 2021
avatar sandramay0905
sandramay0905 - comment - 22 Apr 2021

Confirm Issue, test on nightly build.

avatar brianteeman
brianteeman - comment - 22 Apr 2021

We had this reported before but it was in the template editor. Look for the PR that fixed it there and apply here

avatar sandramay0905
sandramay0905 - comment - 22 Apr 2021

@brianteeman pull request #30241?

avatar brianteeman
brianteeman - comment - 22 Apr 2021

Yes thats the one

avatar infograf768
infograf768 - comment - 22 Apr 2021

Looks like indeed this solves the issue

diff --git a/build/media_source/plg_editors_codemirror/js/joomla-editor-codemirror.w-c.es6.js b/build/media_source/plg_editors_codemirror/js/joomla-editor-codemirror.w-c.es6.js
index ecef691..e99ae93 100644
--- a/build/media_source/plg_editors_codemirror/js/joomla-editor-codemirror.w-c.es6.js
+++ b/build/media_source/plg_editors_codemirror/js/joomla-editor-codemirror.w-c.es6.js
@@ -42,4 +42,10 @@
     const that = this;
 
+    // Check if instance exists to avoid duplication on resize
+    if (this.instance !== '') {
+      Joomla.editors.instances[this.element.id] = this.instance;
+       return;
+    }
+
     // For mode autoloading.
     window.CodeMirror.modeURL = this.getAttribute('mod-path');

avatar dgrammatiko
dgrammatiko - comment - 22 Apr 2021

That's not the correct solution since the problem is not in CodeMirror, a similar issue exists with tinyMCE #33101
The problem is that tabs are actually moving DOM elements when switching from tabs to accordion therefore the proper solution would be to fix the tabs to not move the DOM elements.

avatar PhilETaylor
PhilETaylor - comment - 22 Apr 2021

a similar issue exists with tinyMCE

We had this reported before but it was in the template editor.

The problem with the template editor, when using out of the box configuration (CodeMirror) still remains today unresolved.

avatar dgrammatiko
dgrammatiko - comment - 22 Apr 2021

using out of the box configuration

What do you mean here? Can you provide an example?

avatar brianteeman
brianteeman - comment - 22 Apr 2021

I thought it was fixed as well but I can confirm its broken

issue

avatar PhilETaylor
PhilETaylor - comment - 22 Apr 2021

Simple.

  1. Install Joomla 4 from 4.0-dev today
  2. Navigate to System -> Site Templates -> Cassiopeia Details and Files -> Click Index.php
  3. Resize the screen:
Screen.Recording.2021-04-22.at.08.08.30.pm.mp4
avatar dgrammatiko
dgrammatiko - comment - 22 Apr 2021

Yeah, that's from tabs and the stupid mode change to accordion. I shouldn't have pushed that stupid code...

avatar PhilETaylor
PhilETaylor - comment - 22 Apr 2021

Its been like this for quite some time... I reported it in 2018... #22778

avatar infograf768
infograf768 - comment - 24 Apr 2021

So... What now?

avatar Quy Quy - close - 17 Jul 2021
avatar Quy
Quy - comment - 17 Jul 2021

Please test PR #34813

avatar Quy Quy - change - 17 Jul 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-07-17 20:49:02
Closed_By Quy

Add a Comment

Login with GitHub to post a comment