Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#11211 closed Bug (invalid)

The data within the editor is disappeared when you select other tab.

Reported by: aziz@… Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: Cc:

Description

When you select other tab in application, the data within the editor disappears. It throws an error "Uncaught TypeError: Cannot call method 'getSelection' of undefined". The editor also becomes uneditable. Application is developed using GWT.

In order to reproduce bug:

  1. Sign in to aws.kpi.com. And navigate to CRM from top menu.

You can use these credentials: Login - ckeditor@… Password - ckeditor1

  1. Go to Add New->Case (see screenshot. Step 1)
  2. Write some data in CKEditor
  3. Switch to other tab, e.g. 'Message Center' (see screenshot. Step 2). Then return to Add Message tab.
  4. The data within the editor is lost and editor becomes uneditable

Please resolve the issue

Attachments (1)

CkeditorProblem.png (44.8 KB) - added by aziz@… 11 years ago.

Download all attachments as: .zip

Change History (7)

Changed 11 years ago by aziz@…

Attachment: CkeditorProblem.png added

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

Resolution: invalid
Status: newclosed

Before removing editor from DOM you've got to destroy it using editor.destroy() method. I guess that this is the reason why error is thrown - you remove it from DOM when switching tabs, but don't destroy it.

I cannot login to your CRM though (login and password do not work), so I cannot check it though.

comment:2 Changed 11 years ago by Jakub Ś

Hi,

Thanks for credentials. I have check implementation and I have couple of questions to ask.

  1. I got same error in both cases.
    1. I have loaded new case, typed few words and then pressed outside browser window and waited.
    2. Applied your TC and waited
  2. In both cases I have got "LZString is not defined" which is thrown somewhere around such code LZString.compressToUTF16(JSON.stringify.
  3. I have then checked your build-config.js files and noticed that you use one custom plugins which is autosave - could it be that this is happening because of this plugin?

You could try same TC without it and if that is the case report it to plugin author (This is third-party plugin).

comment:3 in reply to:  2 Changed 11 years ago by aziz@…

Hi, "LZString is not defined" error disappeared after I removed autosave plugin. But I guess it was not causing the problem.

After editor is frozen and you press some button in editor. Chrome says: Uncaught TypeError: Cannot call method 'getSelection' of undefined Firefox says: TypeError: this.document.getWindow(...).$ is undefined error

Replying to j.swiderski:

Hi,

Thanks for credentials. I have check implementation and I have couple of questions to ask.

  1. I got same error in both cases.
    1. I have loaded new case, typed few words and then pressed outside browser window and waited.
    2. Applied your TC and waited
  2. In both cases I have got "LZString is not defined" which is thrown somewhere around such code LZString.compressToUTF16(JSON.stringify.
  3. I have then checked your build-config.js files and noticed that you use one custom plugins which is autosave - could it be that this is happening because of this plugin?

You could try same TC without it and if that is the case report it to plugin author (This is third-party plugin).

comment:4 in reply to:  1 Changed 11 years ago by aziz@…

I'm not removing anything. Maybe GWT switch tab code doing some DOM manipulations under the hood. But I don't have control over it. And I don't need to destroy the editor. It should be shown if the user re-switches to the tab with editor.

Replying to Reinmar:

Before removing editor from DOM you've got to destroy it using editor.destroy() method. I guess that this is the reason why error is thrown - you remove it from DOM when switching tabs, but don't destroy it.

I cannot login to your CRM though (login and password do not work), so I cannot check it though.

Last edited 11 years ago by aziz@… (previous) (diff)

comment:5 Changed 11 years ago by Jakub Ś

So what you are saying is that you still get error despite removing autosave plugin.

Could you perhaps try destroying editor before changing tabs or closing tab and creating it when tab is opened/created? Perhaps this will solve your issue? On each tab click you can destroy old and create new editor.

As for the data you could write it somewhere on editor destroy and load it on editor creation.

comment:6 Changed 11 years ago by Piotrek Koszuliński

Maybe GWT switch tab code doing some DOM manipulations under the hood. But I don't have control over it.

But CKEditor does not have control too. But I'm rather sure that GWT allows to listen on tab changes.

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