Opened 8 years ago

Closed 6 years ago

#8647 closed Bug (fixed)

Placeholder plugin bug

Reported by: dgaspar Owned by:
Priority: Normal Milestone:
Component: General Version: 3.5
Keywords: Mac Cc:

Description

In the placeholder demo: http://nightly.ckeditor.com/7350/_samples/placeholder.html

Here's how to reproduce the bug (chrome mac):

  • Fully erase the demo text
  • add a placeholder, ex: MY_VARIABLE
  • switch to source
  • switch back to html
  • select part of the placeholder with the mouse (ex: select "IABLE]")
  • press ctl+b

The placeholder is now broken:

<p>
	[[MY_VAR<span id="cke_bm_49S" style="display: none; ">&nbsp;</span><span style="display: none; ">&nbsp;</span>IABLE]<span style="display: none; ">&nbsp;</span><span id="cke_bm_49E" style="display: none; ">&nbsp;</span>]</p>

And an error is triggered: _source/styles/plugin.js, line 465: Uncaught TypeError: Cannot call method 'getPosition' of null

if (currentNode.getPosition( lastNode ) == CKEDITOR.POSITION_FOLLOWING )
			currentNode = 0;

It should probably be:

if ( currentNode && currentNode.getPosition( lastNode ) == CKEDITOR.POSITION_FOLLOWING )
			currentNode = 0;



Bonus: another bug when

  • select the whole placeholder text
  • ctrl+b
  • now select just a part of the placeholder string (in bold)
  • ctrl+b again

The placeholder is now broken.

<p>
	This is <strong>a [[sa</strong>mple <strong>placeholder]]. You</strong> are using <a href="http://ckeditor.com/">CKEditor</a>.</p>

Change History (3)

comment:1 Changed 8 years ago by Jakub Ś

Keywords: Mac added; placeholder removed
Status: newconfirmed
Version: 3.6.3 (SVN - trunk)3.5

comment:2 Changed 8 years ago by Jakub Ś

It seems that second TC can be reproduced ont only in Mac but also in Windows under Opera 11.50, Chrome 16, Safari 5.1.2 and Firefox9

The first TC is only reproducible on Mac

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

Resolution: fixed
Status: confirmedclosed

Fixed in CKEditor 4.3. Partial placeholder selection is not possible any more.

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy