Insert html lost current selection under safari. it works fine under chrome and firefox, but doesn't work under safari.
Steps to reproduce using safari(put the test file in the same folder with the ckeditor samples):
1. open the test file
2. click any position in the editor
3. click safari address bar or search input box on the top
4. click execute button to insert image
5. it will insert the image at the beginning.
CKEditor version 3.0 and 3.02
OS: Mac OSX 10.5
Safari: 4.04(5531.21.10)
Seems the ckeditor lost the current selection when I click the address bar of safari, any one got ideas to prevent that? thanks
Here's the test html:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta content="text/html; charset=utf-8" http-equiv="content-type"/> <script type="text/javascript" src="../ckeditor.js"></script> </head> <body> <p> <textarea id="commands" cols="100" rows="8" name="commands" rows="5"> try{ var oEditor=CKEDITOR.instances.htmlEditor; oEditor.focus(); oEditor.insertHtml("<img src='http://www.google.com/images/nav_logo7.png'>"); oEditor.fire( 'saveSnapshot' ); } catch(e){ e.toString(); } </textarea> <input name="execute" type="button" value="Execute" onClick="return eval(document.getElementById('commands').value);"/> </p> <p> <textarea cols="80" id="htmlEditor" name="htmlEditor" rows="10"><p>This is some <strong>sample text</strong>. You are using <a href="http://ckeditor.com/">CKEditor</a>.</p></textarea> <script type="text/javascript"> //<![CDATA[ CKEDITOR.replace( 'htmlEditor' ); //]]> </script> </p> </body> </html>