Opened 14 years ago

Last modified 12 years ago

#5842 confirmed Bug

Keyboard Cursor No Longer Visible When After Showing CKEditor in a DIV that was display:none

Reported by: Erik Kangas Owned by:
Priority: Normal Milestone:
Component: General Version: 3.3.1
Keywords: Firefox Cc: Erik Kangas


  • Place CKEditor 3.3.1 inside a DIV or other element
  • Editing works fine
  • Hide the CKEditor by changing that enclosing DIV's "display" CSS properly to "none".
  • Show the CKEditor again later by changing the CSS "display" back to "block".

The result is that the CKEditor works OK, but the cursor is never displayed. If you type ... you may see your results, but without any visible cursor.

You can get the cursor back by changing the CKEditor mode to "source" and then back to "wysiwyg". This is not a very user friendly Work Around.

Issue observed in FireFox 3.6 on Mac and Windows XP. Have not tried it in other browsers yet.

This issue did not exist with CKEditor 3.1.

Attachments (1)

1111.html (1.2 KB) - added by Jakub Ś 13 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 14 years ago by Erik Kangas

It would be nice if there was some work around other than what we do now:

  • get data
  • set data
  • focus

This works -- but is slow and causes people to lose the cursor position. It does bring the keyboard cursor back to be visible again, which just clicking in the edit area after display does not.

It seems like this is related to sole old bugs where FCKEditor was not being set editable after some parent object became visible again. However, I can't find any function to manually make it editable anymore (like the FCK API function MakeEditable).

comment:2 Changed 13 years ago by Jakub Ś

Keywords: Firefox added
Status: newconfirmed

I was able to reproduce the behavior described by @kangas only till version 3.2.2.

Form CKEditor 3.3.1 different behavior can be observed in Firefox browsers.

  1. Place 1111.html file in samples folder.
  2. Open file in a browser
  3. Click inside editor and start typing (type two words, you have got 5 seconds:))
  4. After editor reappears try to place the cursor by clicking on line of text you have typed or somewhere behind this text but on the same height as this line.

Result: In Firefox 3.6 and 4 it is impossible to place the cursor. NOTES:

  1. If you click with your mouse somewhere below or above the line of text the cursor appears.
  2. I have used the same example but instead of timeouts I have used buttons (just like in #7534). When buttons were used everything was fine. Maybe it has got something to do with focus placed on those buttons.
  3. In Firefox 5 cursor appears at the beginning of text but If start typing without changing cursor location old text jumps one line down, so that you have two lines of text in two paragraphs. I have reported this behavior in ticket #8209

comment:3 Changed 13 years ago by Jakub Ś

#8209 is related

Changed 13 years ago by Jakub Ś

Attachment: 1111.html added

comment:4 Changed 12 years ago by Garry Yao

The bug is affected only when trying to blow off the editor while cursor is still blinking inside of the document, plus the fact that I cannot reproduce it in latest FF as well.

So it looks for me this browser quirk could be work around by the developer from clearing the editor selection before hiding the editor instead of considering a fix from our side.

comment:5 Changed 12 years ago by Jakub Ś

A workaround to for #5842 and #8209 brought to you by @garry.yao. Below is the modified code for 1111.html

var editor = CKEDITOR.appendTo( 'editor1' );
setTimeout( function()
	var focused = editor.focusManager.hasFocus;
	if ( focused )
		var sel = editor.getSelection();

	document.getElementById( 'editor1' ).style.display = 'none';
	setTimeout( function()
		document.getElementById( 'editor1' ).style.display = 'block';

		if ( focused )
			setTimeout( function() { editor.getSelection().unlock( true ); } );
	}, 1000 );
}, 5000 );
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