PDA

View Full Version : little Bug on IE 7 form.htmleditor



blubbi
11 Jul 2007, 9:52 AM
Hello,

i have a Bug found into form.htmleditoron IE 7.0.5730.11 with

ext-1.1-rc1/ext-all.js
ext-1.1-rc1/adapter/yui/yui-utilities.js
ext-1.1-rc1/adapter/yui/ext-yui-adapter.js

No error is on console!
Wenn i make a list, can't make a next number ...

Please see the image:
http://img442.imageshack.us/img442/4650/errror2oy6.jpg



GridDialogEditor = new Ext.form.HtmlEditor({
id: 'dataeditor',
fieldLabel: 'Text',
width:550,
height:250,
enableAlignments: false,
enableColors: false,
enableFont: false,
enableFontSize: false,
enableFormat: true,
enableLinks: false,
enableLists: true
});

sorry for my bad english ...

greeting,
blubbi

blubbi
11 Jul 2007, 11:20 PM
works fine! :)

@mystix: OK!

KRavEN
24 Jul 2007, 11:23 AM
No, it doesn't work fine. I'm seeing the same exact thing. Works fine in firefox but IE6 and IE7 have the problem with the bullet and number lists. No javascript errors are thrown by IE.

gricceri
28 Jul 2007, 2:21 PM
I found a solution to solve this bug, but you have to override the HtmlEditor fixKeys method for IE:



return function(e){
var k = e.getKey(), r;

//start of trick
var sel = document.selection.createRange();
var pel = sel.parentElement();
var isLI= pel.tagName.toLowerCase() == 'li';
//end
if(k == e.TAB){
e.stopEvent();
r = this.doc.selection.createRange();
if(r){
r.collapse(true);
r.pasteHTML('    ');
this.deferFocus();
}
}else if(k == e.ENTER && !isLI /* isLI instead of !e.getTarget('li')*/ ){
e.stopEvent();
r = this.doc.selection.createRange();
if(r){
r.pasteHTML('<br />');
r.collapse(false);
r.select();
}
}
};





I noticed too, that in Safari 3, some disabled commands works ( list and source code ).

Using this code to detect Safari 3


var ua = navigator.userAgent.toLowerCase();
Ext.isSafari3 = (/webkit|khtml/).test(ua) && ua.indexOf("version/3")>0


it's possible to replace where occur the condtion (!isSafari) with (!isSafari || isSafari3), and hence enable disabled commands.

Hope this help.

jack.slocum
28 Jul 2007, 4:31 PM
gricceri,

Thanks. This is what I ultimately settled on:



if(Ext.isIE){
return function(e){
var k = e.getKey(), r;
if(k == e.TAB){
e.stopEvent();
r = this.doc.selection.createRange();
if(r){
r.collapse(true);
r.pasteHTML('&nbsp;&nbsp;&nbsp;&nbsp;');
this.deferFocus();
}
}else if(k == e.ENTER){
r = this.doc.selection.createRange();
if(r){
var target = r.parentElement();
if(!target || target.tagName.toLowerCase() != 'li'){
e.stopEvent();
r.pasteHTML('<br />');
r.collapse(false);
r.select();
}
}
}
};
}

gricceri
29 Jul 2007, 3:22 AM
..that is better, obviously ;)
Going to paste!

jack535
3 Mar 2008, 8:16 AM
I have the same problem as stated above but I'm not using the yahoo includes, I'm just using the standard install of ext JS.

When I tried and copy the code jack posted I get an error saying invalid return.

Any idea's why.