Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML5: Why aren't people using "ContentEditable" for their websites Comment input?

The contenteditable attribute looks so wonderful for something like a comment box for websites, doesn't it? It shows all the formatting, unlike inputs, so, is it possible? is it smart? I saw that IE doesn't support it? Would it be easy to create a fallback input to show if the browser doesn't support contenteditable?

good idea or bad?

like image 842
android.nick Avatar asked Dec 19 '10 07:12

android.nick


1 Answers

I think the trick is checking whether the browser supports it.. Current versions of most modern desktop browsers seem to support it just fine (though they do so differently, and with different commands), but mobile browsers I've checked have issues. Because they simply behave incorrectly while offering all of the same attributes and functions as their desktop counterparts, figuring out whether it's truly supported is tricky. So, if it's something simple like a comment form where formatting might be nice to have but isn't strictly necessary, probably more trouble than it's worth.

That said, adding contenteditable areas using progressive enhancement to replace textareas seems to work very nicely, so you can definitely provide a fallback.. if you can figure out whether the browser needs it.

like image 139
garann Avatar answered Nov 03 '22 14:11

garann