Fix keyboard status when switching between entities editor tabs

This commit is contained in:
David Rowe 2016-09-30 14:13:35 +13:00
parent a0dd3d8771
commit ad5d525340

View file

@ -47,10 +47,21 @@ function setUpKeyboardControl() {
}
}
function documentBlur() {
// Action any pending Lower keyboard event immediately upon leaving document window so that they don't interfere with
// other Entities Editor tab.
if (lowerTimer !== null) {
clearTimeout(lowerTimer);
doLowerKeyboard();
}
}
var inputs = document.querySelectorAll("input[type=text], input[type=number], textarea");
for (var i = 0, length = inputs.length; i < length; i++) {
inputs[i].addEventListener("focus", raiseKeyboard);
inputs[i].addEventListener("blur", lowerKeyboard);
}
window.addEventListener("blur", documentBlur);
}