1
0
mirror of https://github.com/webslides/WebSlides.git synced 2025-08-18 19:02:00 +02:00

Preventing navigation with keys if user using inputs

Fixes #50
This commit is contained in:
Antonio Laguna
2017-03-02 09:43:08 +01:00
parent 440e1bf37e
commit 23ad0338cb

View File

@@ -25,6 +25,18 @@ export default class Keyboard {
let method;
let argument;
// Check if there's a focused element that might use the keyboard.
if (document.activeElement) {
const isContentEditable = document.activeElement
.contentEditable !== 'inherit';
const isInput = ['INPUT', 'SELECT', 'OPTION', 'TEXTAREA']
.indexOf(document.activeElement.tagName) > -1;
if (isInput || isContentEditable) {
return;
}
}
switch (event.which) {
case Keys.AV_PAGE:
case Keys.SPACE: