More aggressive retaining of focus

Try to keep the virtual keyboard up even more. Only release focus
when it is absolutely necessary.
This commit is contained in:
Pierre Ossman 2017-02-09 14:20:37 +01:00
parent 0ae5b50a0e
commit b345859ed6
1 changed files with 15 additions and 9 deletions

View File

@ -1479,15 +1479,21 @@ var UI;
return;
}
// Allow clicking on links
if (event.target.tagName === "A") {
return;
}
// And form elements, except standard noVNC buttons
if ((event.target.form !== undefined) &&
!event.target.classList.contains("noVNC_button")) {
return;
// Only allow focus to move to other elements that need
// focus to function properly
if (event.target.form !== undefined) {
switch (event.target.type) {
case 'text':
case 'email':
case 'search':
case 'password':
case 'tel':
case 'url':
case 'textarea':
case 'select-one':
case 'select-multiple':
return;
}
}
event.preventDefault();