Disable key bindings when typing in a contentEditable element.

Review Request #8931 — Created May 8, 2017 and submitted — Latest diff uploaded

Information

Review Board
release-2.5.x
a9310d3...

Reviewers

Our CodeMirror widget defaults to using the browser's contentEditable
support when on a mobile device, instead of handling its own version of
focus and key events. This allows key events to bubble up, eventually
being captured by the diff viewer's key bindings support, creating a
pretty terrible experience as the page begins to jump around or delete
your comment in reaction to the keys being pressed.

Just like we ignore text areas and input fields, we now ignore elements
that have contentEditable set, preventing key bindings from being
handled.

Added some logging to the key bindings code and verified that they
weren't being handled when typing in the comment dialog. I no longer got
the page jumps or other weird behavior when typing on an iPad.