Opened 8 years ago

#16952 new Bug

JS error when using div plugin next to a text node

Reported by: Xavier Portebois Owned by:
Priority: Normal Milestone:
Component: General Version: 4.7.0
Keywords: div Cc:

Description

Steps to reproduce

  1. use an instance with the source and div buttons, like the one in http://sdk.ckeditor.com/samples/fullpreset.html
  2. click on Source and replace the full content with a simple div, like <div>myText</div>
  3. place the cursor at the end of myText (or in between)
  4. click on the div button in toolbar
  5. click on the OK button in the dialog

Expected result

  1. the dialog closes
  2. in the editor, a div is created

Actual result

  1. the dialog doesn't close
  2. there is a javascript error: currentNode.getParent(...) is null (div.js:147)
  3. in the editor, there is a new <span style="display:none">&nbsp;</span> where the cursor was

Other details (browser, OS, CKEditor version, installed plugins)

As far as I understand the div plugin, there is a curious behavior with text nodes: the addon tries to find a common ancestor, and mixes up regular tags with a #text which doesn't have any ancestor, causing the null exception.

Change History (0)

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