Search code examples
internet-explorereditoryuiinternet-explorer-11

Rich Text (YUI) Editor Broken on IE11


I'm running Internet Explorer 11 and YUI 2: Rich Text Editor seems not working. Please see attached screen shot for more detail. Any ideas how to fix this under IE11?

enter image description here


Solution

  • For IE changed its User-Agent, YUI(2.9) need a surgery.

    1. Modify yahoo-dom-event.js: Find this: YAHOO.env.parseUA, then at last add something that tell YAHOO.env.ua now is undering IE 11. like this:

       if (g.ie == 0 && c.indexOf('Trident') != -1){
           g.ie = 11;
       }
      
    2. Modify editor.js: Find the _setInitialContent function, and after the if-branch that includes "BackCompat", add this:

      this.browser = YAHOO.env.parseUA();
      

      then just in the following if-branch (if (this.browser.ie || this.browser.webkit || this.browser.opera || (navigator.userAgent.indexOf('Firefox/1.5') != -1))): add this:

       if (this.browser.ie == 11) {
           this.browser.ie = 0;
       }
      

    Hope Works, Good Luck!