Opened 15 years ago
Last modified 13 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 |
Description
- 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)
Change History (6)
comment:1 Changed 15 years ago by
comment:2 Changed 14 years ago by
Keywords: | Firefox added |
---|---|
Status: | new → confirmed |
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.
- Place 1111.html file in samples folder.
- Open file in a browser
- Click inside editor and start typing (type two words, you have got 5 seconds:))
- 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:
- If you click with your mouse somewhere below or above the line of text the cursor appears.
- 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.
- 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
Changed 14 years ago by
comment:4 Changed 13 years ago by
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 13 years ago by
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(); sel.lock(); } document.getElementById( 'editor1' ).style.display = 'none'; setTimeout( function() { document.getElementById( 'editor1' ).style.display = 'block'; if ( focused ) { editor.focusGrabber.focus(); setTimeout( function() { editor.getSelection().unlock( true ); } ); } }, 1000 ); }, 5000 );
It would be nice if there was some work around other than what we do now:
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).