dijit.Editor Firefox: cursor is displayed on the far right instead of the left
Run the attached example. The example has two editors; one of them works as expected in Firefox and one of them does not. I found that if the editor starts with: '<p></p>', when you click in the editor, the cursor is displayed in the wrong location (it is displayed in the far right of the div rather than the left). Further, this only happens if the hide and then display the editor div before clicking in the editor window.
<html dir="ltr">
<head>
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/dojo/1.5/dijit/themes/tundra/tundra.css"/>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/dojo/1.5/dojo/dojo.xd.js" djConfig="parseOnLoad: true">
</script>
<script type="text/javascript">
dojo.require("dijit.Editor");
</script>
<body style="width:600px" class="tundra">
<script>
// Toggle a div
function toggle(elem) {
var e = document.getElementById(elem);
if (e.style.display == 'none')
e.style.display='';
else
e.style.display='none';
}
</script>
<p>
This version works on Firefox. Click the Toggle State button twice and click in the editor window. The cursor is displayed as expected.
<br/>
<button onclick="toggle('editor1');">Toggle State</button>
<br/>
<div style="width:400px;height:300px" dojoType="dijit.Editor" id="editor1"></div>
</p>
<br/><br/>
<p>
This version does not work. When you click the Toggle State button twice and click in the editor window, the cursor is displayed on the far right of the div. Once the div contains any text, it works correctly.
<br/>
<button onclick="toggle('editor2');">Toggle State</button>
<br/>
<div style="width:400px;height:300px" dojoType="dijit.Editor" id="editor2"><p></p></div>
</body>
</html>
Change History (8)
Component: |
General →
Editor
|
Owner: |
anonymous deleted
|
Milestone: |
tbd →
1.6
|
Owner: |
set to Jared Jurkiewicz
|
Resolution: |
→ fixed
|
Status: |
new →
closed
|
This is definitely a firefox bug. Will put in a simple workaround.