Opened 10 years ago

Last modified 8 years ago

#11342 closed Bug

[IE11] Extra paragraphs added when showing/hiding divs with CKEditor — at Version 18

Reported by: Wiktor Walc Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: IE11 Support Cc: joel.peltonen@…

Description (last modified by Piotrek Koszuliński)


Extra paragraphs added when switching between tabs.

In IE 11, when using two tabs (using jQuery UI), one with CKEditor and one with plain text, whenever user switches to a tab with CKEditor and back, an additional paragraph is added at the end of content.

Content after a couple of switches:

<p>Magical ponies await</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;
<p>&nbsp;
<p>&nbsp;</p>
</p>
</p>

Change History (23)

comment:1 Changed 10 years ago by Wiktor Walc

Description: modified (diff)

Changed 10 years ago by Wiktor Walc

Attachment: 11342.zip added

comment:2 Changed 10 years ago by Wiktor Walc

Status: newconfirmed

The attached file contains the sample and all required files to reproduce it.

comment:3 Changed 10 years ago by Wiktor Walc

Summary: [IE11, jQuery UI] Extra paragraphs added when switching to source mode[IE11, jQuery UI] Extra paragraphs added when switching between tabs

comment:4 Changed 10 years ago by Joel

Cc: joel.peltonen@… added

Add CC

comment:5 Changed 10 years ago by Wiktor Walc

Description: modified (diff)
Summary: [IE11, jQuery UI] Extra paragraphs added when switching between tabs[IE11] Extra paragraphs added when showing/hiding divs with CKEditor

Changed 10 years ago by Wiktor Walc

Attachment: IE11_bug.html added

comment:6 Changed 10 years ago by Jakub Ś

After latest update in my Win 8.1 preview (IE11 11.0.9431.228) I wasn't able to reproduce this.

I have also tried this issue on Win7 (IE11 11.0.09600.16476) and was able to reproduce both of these problems.

Last edited 10 years ago by Jakub Ś (previous) (diff)

comment:7 Changed 10 years ago by Piotrek Koszuliński

Description: modified (diff)

I couldn't reproduce any problem on IE11_bug.html, but when switching tabs in 11342.zip new paragraphs are added below text. I'm checking this on IE11.0.9600.16476.

comment:8 Changed 10 years ago by Joel

Anyone test on IE10?

comment:9 Changed 10 years ago by Jakub Ś

Keywords: Support added

comment:10 Changed 10 years ago by Piotrek Koszuliński

We'll try to investigate this issue for CKEditor 4.3.3. Although, I don't have any idea yet whether it's something serious or whether the fix will be possible now.

comment:11 Changed 10 years ago by Ole K

Hi,

I noticed when setting "config.enterMode = CKEDITOR.ENTER_BR;" it does not seem to happen.

But then I get some "<br />" at the end of the document...

That is how i have configured it:

config.coreStyles_italic = { element : 'i', overrides : 'em' }; config.enterMode = CKEDITOR.ENTER_BR; config.autoParagraph = false; config.fillEmptyBlocks = false;

And I have to really clear the IE11 cache every time... But thats maybe because of my ASP.NET project

As a workaround for ASP.NET i have added the following lines to CKEditorControl.cs:

public override string Text
{
    get
    {
        return base.Text;
    }
    set
    {
        // Ole: clean up some stuff before saving
        value = System.Text.RegularExpressions.Regex.Replace(value, @"(<br /><br />&nbsp;)$", "");
        value = System.Text.RegularExpressions.Regex.Replace(value, @"<p>&nbsp;<p>&nbsp;<p>&nbsp;</p></p></p>$", "");
        // optionally clean all empty paragraphs
        value = System.Text.RegularExpressions.Regex.Replace(value, @"<p>&nbsp;</p>", "");

        base.Text = value;
    }
}
Last edited 10 years ago by Ole K (previous) (diff)

comment:12 Changed 10 years ago by Piotrek Koszuliński

Milestone: CKEditor 4.4.1

comment:13 Changed 10 years ago by Jani Ollikainen

I'm seeing this also. And can reproduce it with that IE11_bug.html.

Version: 11.0.9600.17041 Update Versions: 11.0.7 (KB2929437)

In my environment this is kind of nasty bug which is really annoying. Would appreciate lower milestone as 4.4.1.

comment:14 Changed 10 years ago by Jani Ollikainen

If the editor is in source mode, then no extra paragraphs are added.

comment:15 Changed 10 years ago by Piotrek Koszuliński

Owner: set to Piotrek Koszuliński
Status: confirmedassigned

Changed 10 years ago by Piotrek Koszuliński

Attachment: 11342_3.html added

Changed 10 years ago by Piotrek Koszuliński

Attachment: 11342_editable.html added

Changed 10 years ago by Piotrek Koszuliński

Attachment: 11342_2.html added

comment:16 Changed 10 years ago by Piotrek Koszuliński

Milestone: CKEditor 4.4.1
Owner: Piotrek Koszuliński deleted
Status: assignedconfirmed

Unfortunately this turned out to be an ugly IE11 bug. It can be reproduced without CKEditor. Download 11342_3.html and 11342_editable.html and open the first sample. Then open console and press show/hide few times. You'll see <br> appended and removed. What's funny, showing "editor" appends 2 <br>s when hiding removes one.

I can't think of any reasonable hack we could implement. We don't know the source of those <br>s, so we cannot arbitrarily remove them. However, you can implement a workaround - after showing editor just remove any <br> which is a direct descendant of editable. That's it.

Also, note that this issue cannot be reproduced on inline editor (see 11342_2.html), so you could also use the divarea.

comment:18 Changed 10 years ago by Piotrek Koszuliński

Description: modified (diff)
Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy