Skip to content

Fix global keyboard shorcuts interference with CodeMirror search query input

Administrator requested to merge fkling/33208-global-keyboard-shortcuts into main

Created by: fkling

Fixes #33208 (closed)

The logic we use in a couple of places to determine whether events originate in an input element doesn't work for CodeMirror because it uses a contenteditable element (unlike, apparently, Monaco). Note that not all those places interfere with the CodeMirror query input but I thought it would make sense to use the same function everywhere.

Not sure whether that's the best place to put this logic.

Test plan

New unit test

Enabled CodeMirror query input ("editor": "codemirror6" in user settings) and verified that typing y in the input on a blob page doesn't trigger the global keyboard shortcut anymore.

App preview:

Merge request reports

Loading