Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#13482 closed Bug (invalid)

Error trying to use font and size dropdown after removing and appending toolbar to node

Reported by: Mike Kuenzi Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: Cc: kuenzim@…

Description

==Summary==

I get this error in Chrome:

Cannot read property 'data-cke-expando' of undefined

Which comes from line 212 of domobject.js

I get a different error in IE/Firefox

Unable to get property 'getName' of undefined or null reference

In element.js line 1378

==Steps to reproduce==

Using attached sample, follow these steps:

  1. Click Show Editing Tools
  2. Make a selection
  3. Change the font size and font of your selection.
  4. Click Hide Editing Tools
  5. Click Show Editing Tools
  6. Try to open Font or Size drop down, error will occur here

Other information

I had this same issue with the nightly build.

Attachments (1)

bug.zip (1.4 MB) - added by Mike Kuenzi 9 years ago.

Download all attachments as: .zip

Change History (8)

Changed 9 years ago by Mike Kuenzi

Attachment: bug.zip added

comment:1 Changed 9 years ago by Mike Kuenzi

Cc: kuenzim@… added

comment:2 Changed 9 years ago by Mike Kuenzi

Summary: Error trying to change use font and size dropdown after removing and appending toolbar to nodeError trying to use font and size dropdown after removing and appending toolbar to node

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

Resolution: invalid
Status: newclosed

I'm sorry, but cloning a toolbar is not a valid usage. Those nodes in the initial toolbar have the whole application bound to them. When cloning a toolbar you may break it.

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

PS. I don't understand why you clone the toolbar. Can't you just show and hide it?

comment:5 Changed 9 years ago by Jakub Ś

I agree with @Reinmar - why not just showing and hiding the toolbar?

When debugging the exception I have noticed that code (in method which throws error) current = current.getParent(); returns null at certain point for the toolbar element.

It looks a little bit like this element is detached from DOM (has no parent) what ,kind of matches what was written about cloneNode method - https://developer.mozilla.org/en-US/docs/Web/API/Node/cloneNode.

Perhaps it would be best to change the approach?

comment:6 Changed 9 years ago by Mike Kuenzi

I guess I was trying to build an approach where I could change the location of the toolbar. I suppose moving it around wouldn't cause this issue perhaps?

Basically depending on what you are editing I show different sets of tools. I'm using Knockout to show a series of Tabs, and those tabs may vary depending on what is being edited

Would it ever make sense to allow CKEDITOR to initialize it's toolbar in a specified place using a method? Maybe it doesn't, it's just a thought.

Thanks for the prompt response

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

You may find this helpful - http://sdk.ckeditor.com/samples/sharedspace.html.

Moving it around, hiding, showing - all should be safe.

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