Opened 11 years ago
Closed 11 years ago
#10801 closed defect (fixed)
Editor : placeCursorAtStart problem on FF if Editor content starts with <br/>
Reported by: | jfcunat | Owned by: | Jared Jurkiewicz |
---|---|---|---|
Priority: | high | Milestone: | 1.4.2 |
Component: | Editor | Version: | 1.4.0 |
Keywords: | Cc: | Jared Jurkiewicz; [email protected]… | |
Blocked By: | Blocking: |
Description
On Firefox 3.5, when using placeCursorAtStart method on an Ediot that contains content beginning with <br/>, you are not able to type anymore. Cursor is well blinking at the start of the content but you are not able to type anything.
This seems to come from the specific code done for FF in placeCursorAtStart method in RichText?.js . Seems that the behaviour should the same for text node (nodeType=1) than for nodeType 3 element with no childNode.
Test case provided (just click on cursor at start button and try to type in Editor)
Attachments (2)
Change History (13)
Changed 11 years ago by
Attachment: | test_Editor_insertAtStart.html added |
---|
Changed 11 years ago by
Attachment: | childlessTag.patch added |
---|
comment:1 Changed 11 years ago by
The problem, as best I can determine, occurs because certain tags, such as <br> are childless tags, meaning they cannot have text or anything else within them. The logic as it stood would position the cursor inside any tag, childless or not. So what would happen would it would get stuck as you can't type insde a childless tag.
Simple fix (as done in patch), is to determine if the node can have children or not, and position cursor accordingly (before if it cannot, inside if it can).
comment:2 Changed 11 years ago by
comment:3 Changed 11 years ago by
Comitting in a quick fix for 1.4.2 (it's not a regression, though, same issue on 1.3). Will revisit and improve for 1.5
comment:4 follow-up: 6 Changed 11 years ago by
jfcunat,
Can you test this on Dojo 1.4.2 RC1, please? It will be cut very soon.
comment:6 Changed 11 years ago by
Replying to jaredj:
jfcunat,
Can you test this on Dojo 1.4.2 RC1, please? It will be cut very soon.
This is Ok for us, but is it for a performance reason that you do not use childNodes.length as a test ? It it is the case some other empty tags could be added in your test : hr, link?,
comment:7 Changed 11 years ago by
It is not an issue with the tag being empty, it is an issue with the tag not being allowed to have children. childNodes.length would be a bad test. For example, a div with no children is a valid node to select into.
comment:8 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
1.4.2 is out. closing ticket. If more work needs to be done, you can open another ticket or just ref this one, I guess.
comment:9 Changed 11 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Could you just add hr tag in the list of childless tag ?
comment:11 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Patch for problem