Opened 18 years ago
Closed 18 years ago
#1005 closed Bug (fixed)
It isn't possible to insert a PlaceHolder in IE
Reported by: | Alfonso Martínez de Lizarrondo | Owned by: | Martin Kou |
---|---|---|---|
Priority: | Normal | Milestone: | FCKeditor 2.5 Beta |
Component: | General | Version: | SVN (FCKeditor) - Retired |
Keywords: | Confirmed IE | Cc: | Frederico Caldeira Knabben |
Description (last modified by )
This is a regression, 2.4.3 worked fine.
Load sample06.html in IE6, put the cursor inside some text and try to insert a PlaceHolder with any text, it just won't work.
Debugging it, the problem is in internals/fckdomrange_ie.js before the oIERange.pasteHTML('') ; in line 118 the body contains the empty span (and sometimes and extra after or before it), but after it is executed the span is removed, so when it is returned to the plugin, the span isn't in the document and it won't be shown.
Change History (4)
comment:1 Changed 18 years ago by
comment:2 Changed 18 years ago by
Description: | modified (diff) |
---|
The comments says the logic block around that pasteHTML() line is a kludge for a browser bug. I don't know how to reproduce that bug though, so I were to apply a fix here now, I have no way to be certain whether my fix would make that bug appear again. My proposed fix is as follows:
if ( bIsCollapsed ) { oIERange.moveEnd( 'character', 1 ) ; oIERange.select() ; oIERange.collapse( true ) ; oIERange.select() ; }
If this does not work, how about this... instead of pasting a non-breaking space to expand the block in the try {...} block, we paste a <span> with a unique id there. Then we use DOM methods to remove it instead of using pasteHTML( '' ).
comment:3 Changed 18 years ago by
Owner: | set to Martin Kou |
---|---|
Status: | new → assigned |
I've replaced the current kludge with a kludge-upon-kludge in [618] which fixes this bug as well as the bug where empty blocks are not rendered. [618] is not perfect though, and I feel the correct approach to fixing this bug would be to investigate why it worked in 2.4.3 but not in the SVN version.
More investigation is needed.
comment:4 Changed 18 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Fixed with [624]. Now the cursor position after inserting the placeholder is correct.
I can see the oIERange.pasteHTML() line was only intended to delete the non-breaking space added just before it, but it seems to have a side effect of deleting the HTML node that was emptied by the action as well.