PDA

View Full Version : HtmlEditor insertAtCursor bug



insoft
3 Dec 2012, 7:31 AM
HtmlEditor insertAtCursor() method inserts always at the beginning for IE.
Please, find an example in attachment. I've tested it in IE8.
Steps to reproduce:
1) Open app.html and insert several lines of text and put cursor somewhere in the middle of the text
2) select any value from combobox in toolbar
3) see result -> the value is inserted at the beginning of text instead of the last cursor position

40521()

mitchellsimoens
3 Dec 2012, 8:00 AM
I've simplified your test case to:


new Ext.form.Panel({
renderTo : document.body,
items : [
{
xtype : 'htmleditor',
anchor : '100%',
value : 'some text'
}
],
dockedItems : [
{
xtype : 'toolbar',
dock : 'bottom',
items : [
{
text : 'Insert',
handler : function(btn) {
var form = btn.up('form'),
editor = form.down('htmleditor');

editor.insertAtCursor('foo');
}
}
]
}
]
});

When I test this in IE8 on Windows 7 it works as expected for me.

insoft
3 Dec 2012, 8:03 AM
Does it work without simplification? If it does not - why? May be something is wrong with cursor position after you click on combobox and select an item?