Community
Participate
Working Groups
In Firefox, if the edtior is hidden by setting display to "none", the caret will not draw once the editor is made visible again. Paste this in the demo.html: function test() { var parent = document.getElementById("divParent"); parent.style.display = "none"; setTimeout(function(){ parent.style.display = "block"; // editor._clientDiv.contentEditable = false; // editor._clientDiv.contentEditable = true; }, 1000); }
(In reply to comment #0) > the caret will not draw once the editor is made visible again. In addition to that, I also see the Ctrl+C/V shortcuts stop working, and text selection behaves wrong when using the mouse.
(In reply to comment #1) > In addition to that, I also see the Ctrl+C/V shortcuts stop working, and text > selection behaves wrong when using the mouse. Does Orion hide/show the editor ?
Simple test case that shows the problem without using the editor. <!DOCTYPE html> <html> <head> <meta name="copyright" content="Copyright (c) IBM Corporation and others 2010."/> <meta http-equiv="X-UA-Compatible" content="IE=8"/> <meta http-equiv="PRAGMA" content="NO-CACHE"/> <meta http-equiv="Expires" content="-1"/> <title>Caret problem</title> <script language="javascript" type="text/javascript"> function test() { var editor = document.getElementById("editor"); editor.style.display = "none"; setTimeout(function(){ editor.style.display = "block"; }, 1000); } function create() { var frame = document.getElementById("editor"); var frameWindow = frame.contentWindow; var frameDocument = frameWindow.document; var div = frameDocument.createElement("DIV"); div.style.width = "100%"; div.style.height = "100%"; div.style.backgroundColor = "yellow"; div.innerHTML = "Note the caret blinking. Press the button below to hide the IFRAME. Note that the caret is gone once the IFRAME is shown again (after 1 second). Clicking on the div does not bring the caret back."; frameDocument.body.appendChild(div); div.contentEditable = "true"; div.focus(); } </script> </head> <body> <h1>Problem</h1> <iframe id='editor' onload="create()" style="width:400px;height:400px;"></iframe> </iframe> <br> <span onclick='test()' style="color:red;">HIDE BUTTON</span> <br> </body> </html>
This is a bug in Gecko: https://bugzilla.mozilla.org/show_bug.cgi?id=407127 I have a set of patches in that bug which should fix this issue. Test builds including these patches are available at <https://ftp.mozilla.org/pub/mozilla.org/firefox/tryserver-builds/eakhgari@mozilla.com-e6fb454fa6db/>.
Im closing this duplicate (but 337160 has more information), sorry for the confusion. *** This bug has been marked as a duplicate of bug 337160 ***