Fixed content editable elements losing focus on control keys

This commit is contained in:
squidfunk
2019-03-12 16:51:22 +01:00
parent 9a16b9c6ea
commit 1aa8aeb252
3 changed files with 6 additions and 7 deletions

View File

@@ -340,6 +340,11 @@ function initialize(config) { // eslint-disable-line func-style
if (!(query instanceof HTMLInputElement))
throw new ReferenceError
/* Skip editable elements */
if (document.activeElement instanceof HTMLElement &&
document.activeElement.contentEditable === "true")
return
/* Abort if meta key (macOS) or ctrl key (Windows) is pressed */
if (ev.metaKey || ev.ctrlKey)
return