Skip to content

Commit

Permalink
fix(developer): don't use osk-always-visible on touch devices
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mcdurdin committed Oct 31, 2023
1 parent e5ef4e9 commit 4ce16a0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion developer/src/server/src/site/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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'>
Expand Down
4 changes: 4 additions & 0 deletions developer/src/server/src/site/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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/',
Expand Down

0 comments on commit 4ce16a0

Please sign in to comment.