Hello, I have got a div with contenteditable that should trigger a < br /> insert on "enter". Everything works fine in IE but Firefox drives me crazy.
this.e.keydown(function(event) {
if(event.keyCode == 13) {
var execute = editor.insertHTML(\'<br />\')';
eval(execute);
return false;
}
});
Firefox ignores < br /> at the end of the div and I guess at the beginning too. Means, if I press "enter" at the middle of a sentence, it works as it should. Trying the same at the end of a sentence (the very last one) it fails.
Any ideas? The same problem we have at the stackoverflow editor preview :-)
Press "enter" at the end > fail ... press "enter" a single letter earlier > newline