mirror of
https://github.com/keymanapp/keyman.git
synced 2026-09-21 23:27:39 +00:00
fix(developer): don't use osk-always-visible on touch devices
Fixes #9845. It seems that the logic for `osk-always-visible` is not quite right on touch devices -- the OSK disappears on blur but remains touchable -- so presses in the OSK region emit key events. For Keyman Developer Server, the simple workaround is to only use `<body class="osk-always-visible">` when on desktop devices. We should review the logic for `osk-always-visible` in KeymanWeb, so that this issue does not arise on touch devices. This patch addresses the issue in Keyman Developer Server, and matches the behaviour we want on touch devices in any case, as we don't really want the OSK visible when blurred, unlike on desktop.
This commit is contained in:
parent
e5ef4e9ee6
commit
4ce16a08fc
2 changed files with 5 additions and 1 deletions
|
|
@ -21,7 +21,7 @@
|
|||
<link href="inc/keyboards.css" type="text/css" rel="stylesheet" /> <!-- This script loads the dynamic keyboard fonts -->
|
||||
</head>
|
||||
|
||||
<body class='osk-always-visible'>
|
||||
<body>
|
||||
|
||||
<header class='navbar navbar-dark bg-dark text-white'>
|
||||
<div class='container-fluid'>
|
||||
|
|
|
|||
|
|
@ -42,6 +42,10 @@ function enableControls(enable) {
|
|||
let keymanInitialized = false;
|
||||
enableControls(false);
|
||||
|
||||
if(!keyman.util.isTouchDevice()) {
|
||||
document.body.className = 'osk-always-visible';
|
||||
}
|
||||
|
||||
keyman.init({
|
||||
ui:'button',
|
||||
resources:'/resource/',
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue