I've changed &lt;div&gt; to &lt;button&gt; and removed handling of Tab, Enter and Space. It didn't helped with CodeMirror though — I've already tried to avoid this code even before creating the pull request.