Found in w3school's Tryit Editor v2.8... / Firefox selection inside a table



  • So, I was trying to figure out what they'd done to replace this sort of selection business, which is awful:

    0_1461679679771_Untitled.png

    With this, which is exactly what I wanted:
    0_1461679748777_Untitled.png

    This is what I found...

      //23.02.2016: contentEditable is set to true, to fix text-selection (bug) in firefox.
      //(and back to false to prevent the content from being editable)
      //(To reproduce the error: Select text in the result window with, and without, the contentEditable statements below.)  
      if (ifrw.document.body && !ifrw.document.body.isContentEditable) {
        ifrw.document.body.contentEditable = true;
        ifrw.document.body.contentEditable = false;
      }
    

    And it works.

    TRWTF is Firefox, I guess.



  • tabs, not spaces



  • @ben_lubar said in Found in w3school's Tryit Editor v2.8... / Firefox selection inside a table:

    tabs, not spaces

    abcdefg123
    abc123456789
    abcdefg	123
    abc	123456789
    


  • @ben_lubar They are tabs, in both cases.

    The first case was

    6896 {tab}My first HTML {tab}$53
    5869207 {tab}My first
    

    The second was

    3476896{tab}My first HTML
    5869207{tab}My first CSS
    

    Note the spaces at the ends of the fields in the first case. No idea why those are there; they weren't even in the HTML.


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.