From 0cac134d1979b7fe4e5545b05025b1d520465315 Mon Sep 17 00:00:00 2001 From: "Joshua A. Horton" Date: Mon, 10 Jun 2024 08:39:45 +0700 Subject: [PATCH] fix(web): set new-context rules' device to match that of the active OSK Fixes: #11740 --- web/src/engine/main/src/keymanEngine.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web/src/engine/main/src/keymanEngine.ts b/web/src/engine/main/src/keymanEngine.ts index 7e100f0f36e..890574e2840 100644 --- a/web/src/engine/main/src/keymanEngine.ts +++ b/web/src/engine/main/src/keymanEngine.ts @@ -349,6 +349,10 @@ export default class KeymanEngine< this.core.keyboardProcessor.layerStore.handler = this.osk.layerChangeHandler; } this._osk = value; + // As the `new context` ruleset is designed to facilitate OSK layer-change updates + // based on the context being entered, we want the keyboard processor's current + // contextDevice to match that of the active OSK. See #11740. + this.core.keyboardProcessor.contextDevice = value.targetDevice ?? this.config.softDevice; if(value) { // Don't build an OSK if no keyboard is available yet; avoid the extra flash. if(this.contextManager.activeKeyboard) {