PDA

View Full Version : [OPEN-1096] HTMLEditor numbering and bullets bug



Xeon06
1 Jul 2010, 11:42 AM
Hey folks,

I'm looking for a good widgets JavaScript library and in my search I stumbled upon Ext JS. What I need for widgets are a tree widget and some sort of WYSIWYG HTML editor. Looking at the example provided on this page (http://www.sencha.com/deploy/dev/examples/form/dynamic.html), I noticed that the HTMLEditor on "Form 3" had issues with the numbering and bulleting. More specifically, I could write a first line, but everytime I would press the return key after, instead of giving me another bullet or number, it would just keep on writting normal text but keep the indenting. It was then impossible for me to have more than one bullet or number. Further investigation showed me that this bug is only present in Google Chrome (5.0.375.86). No JavaScript errors occur.

Thanks.

Condor
2 Jul 2010, 12:11 AM
This has been reported before.

Some browsers insert a <br /> instead of a </li> (or </p> when not in an <ul>) when pressing Enter.

jimshell
27 Jul 2010, 6:24 PM
Hey Xeon06 and Condor,

I (unfortunately) made a duplicate thread about the similar issue, where I posted a possible workaround:
http://www.sencha.com/forum/showthread.php?105374-DUPE-1096-Strange-behaviour-of-the-HtmlEditor-in-Google-Chrome...&p=494319#post494319

Please let me know if you have the chance to test it, and/or if you prefer me to post the code here in this thread.

Jimshell

DerSalz
22 Nov 2010, 11:24 PM
Hi Condor,

thanks for your explanation. But what is the solution on this? Fact is that you can't use this control the way it works now. I also opened another thread yesterday (sorry but it was too late to find these entries...). IE8 (and IE9 beta) are not supported at all:

http://www.sencha.com/forum/showthread.php?116571-Strange-behaviour-of-htmleditor-in-IE8

Thanks in advance

DerSalz

Joe Kuan
24 Jun 2011, 7:26 AM
Here is my alternate fix and it has been working fine to me



}else if(Ext.isWebKit){
return function(e){
var k = e.getKey();
if(k == e.TAB){
e.stopEvent();
this.execCmd('InsertText','\t');
this.deferFocus();
}else if(k == e.ENTER){
e.stopEvent();
-> var doc = this.getDoc();
-> if (doc.queryCommandState('insertorderedlist') ||
-> doc.queryCommandState('insertunorderedlist')) {
-> this.execCmd('InsertHTML', '</li><br /><li>');
-> } else {
this.execCmd('InsertHtml','<br /><br />');
-> }
this.deferFocus();
}
};