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
- use an instance with the
source
anddiv
buttons, like the one in http://sdk.ckeditor.com/samples/fullpreset.html - click on
Source
and replace the full content with a simple div, like<div>myText</div>
- place the cursor at the end of myText (or in between)
- click on the
div
button in toolbar - click on the
OK
button in the dialog
Expected result
- the dialog closes
- in the editor, a
div
is created
Actual result
- the dialog doesn't close
- there is a javascript error:
currentNode.getParent(...) is null (div.js:147)
- in the editor, there is a new
<span style="display:none"> </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.