JSFiddle - React, Tailwind, and code Playground

by Swivelgames

HTML

<h1>Welcome, Chromium Bug Reviewers! :)</h1>
<div id="mydiv">Click This DIV To Edit Its Contents!</div><hr />
If executed in the current build of Google Chrome (10.0.648.204, Build 79063), a new line will be entered into the DIV! Oh no! Wasn't our JavaScript supposed to fix this?? :(

CSS

#mydiv {
    padding:8px;
    border:1px dotted #000;
}

JavaScript

document.getElementById('mydiv').addEventListener('click', function() {
    this.contentEditable = true;
});
document.getElementById('mydiv').addEventListener('keypress', function(e) {
    if (e.which == 13) alert('Enter was pressed!');
});
document.getElementById('mydiv').addEventListener('blur', function() {
    this.contentEditable = false;
});