Prevent contenteditable auto-focus on Enter keypress on Chrome

Viewed 927

I have a contenteditable div on which I control the behavior of some keys. In particular, I have this:

$('#my_contenteditable').on('keydown', function(e) {
  // Some code...
  if (e.key == 'Enter') {
    $(this).blur();
    e.preventDefault();
    return;
  }
  // Some more code...
});

But after I blured the element, when I press Enter again, Chrome wants to re-focus it.

JSFiddle demo here

Can I prevent this behavior?

3 Answers
Related