Opened 9 years ago

Last modified 9 years ago

#12718 pending Bug

Error on destroying editor, detached from DOM.

Reported by: Danil Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: Cc:

Description

If you remove editor container from DOM and then call editor.destroy(), you got exception, because CKEditor assumes frameElement of editable is available. But element.frameElement is null.

Demo: http://jsfiddle.net/danya_postfactum/wfy9fgdd/2/

Change History (5)

comment:1 Changed 9 years ago by Piotrek Koszuliński

Status: newpending

Why do you destroy editor after detaching it? Can't you do that before?

We know this issue for a while, but we decided to leave it in the developers' hands, because it's hard to imagine how could the editor work after being detached from DOM. Unfortunately, since iframe is unloaded, in dozens of places in code properties/variable that are normally available are now invalid. Adding some try-catch statements or simple checks will only treat symptoms of the issue that you reported and will be a nightmare for debugging, because of those additional checks will mask possible erroneous states.

More about this issue here https://github.com/ckeditor/ckeditor-dev/pull/56#issuecomment-31256359

comment:2 Changed 9 years ago by Danil

This is how ExtJS (3) framework works. It calls "destroy" method on child components after their DOM elements already removed.

Looks like TinyMCE throws exception too.

comment:3 Changed 9 years ago by Piotrek Koszuliński

This is how ExtJS (3) framework works. It calls "destroy" method on child components after their DOM elements already removed.

That's bad... But it is also really surprising. I'm afraid that you need to workaround this.

Looks like TinyMCE throws exception too.

I'm not surprised. But of course I'm not saying that it cannot be "fixed". It'd just make things generally worse.

comment:4 Changed 9 years ago by Danil

Maybe I do something wrong with ExtJS (but I don't think). But I can't understand what's wrong with proposed patch. There is an inconsistence between inline mode and iframe mode: detached inline editor can be destroyed, while iframe editor can't.

comment:5 Changed 9 years ago by Danil

So, what's wrong with if (iframe) check?

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