A directory of browser-based WYSIWYG editors


Home: htmlArea 3 (beta): htmlArea 2 & 3 archive (read only): htmlArea v3.0 - Bug Reports & Fixes:
[BUG CVS] Strange bug with (Control) range

The htmlArea 2 & 3 editors have been discontinued.

We've made these forums available as a read-only reference and knowledge-base for people using or developing editors based on htmlArea 2 or 3.

Anyone who is interested in taking over version 2 or 3 is free to do so. All we ask is that you choose a new name that doesn't have "htmlarea" in it to avoid confusion with this site. We'll even give you a link in the directory to make it easier for people to find you. If you are developing or hosting an htmlArea based-editor under a new name, please submit it to our directory.


New User

Feb 20, 2005, 8:51 PM

Post #1 of 1 (17770 views)
[BUG CVS] Strange bug with (Control) range Can't Post

I am now modifying htmlarea for our CMS. I found and fix a lot of bugs (some fix I have already posted here - some I will post later - for verifying it).
Yesterday I found very strange bug(s) (IE), but I dont know how to fix it. So, I will try you introduce it and I hope someone can help me :)

So, most of us hear about following bug (already fixed in forum): When you try to make a link on image an error accur. There was issue with checking sel.type == Control/Text.

Bug I am now trying introduce is also problem with "Control" and "Text" element.

So now, I will try to explain it really :)

1) Open IE and get htmlrea :)
2) Insert some image
3) Click on Image
4) Insert charater from CharacterMap or try InsertTable (Insert horizontal rule is working right because is using special execCommand)
5) An error accur :)

I analyze the code and I discovered (I hope), that there is a problem in _createRange method, because when image (or other "Control" element) is selected, than is created not textRange but ControlRange (see MSDN
And here is a problem - ControlRange has not same method as textRange - there is missing pasteHTML (and htmlText) method - and this is the problem.

Possible solutions:
1) Try "convert" ControlRange to textRange or get range another way, how?
2) Add some try/catch statement?
3) Highlight image similar as text - not by clicking on it (its not friedly for users :) )
4) Try using updateToolbar method when selection is changed and disable the buttons which cause this error (InsertImage, Table, CharMap etc) - its not great solution :)
5) Any other solution(s)? Post it :) !

In Gecko is all working right (the code is different). Thanks for any headups or solutions.

(This post was edited by iRAY on Feb 21, 2005, 7:05 AM)


Search for (options)