From 8826bec8fe0de527675dbee5ce73d2037e06bdbb Mon Sep 17 00:00:00 2001 From: jahorton Date: Fri, 17 Sep 2021 14:58:18 +0700 Subject: [PATCH] fix(web): incorporates some review suggestions --- web/source/dom/domManager.ts | 6 ++++-- web/source/osk/oskView.ts | 8 ++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/web/source/dom/domManager.ts b/web/source/dom/domManager.ts index 8f3191fe63..9891ba9c31 100644 --- a/web/source/dom/domManager.ts +++ b/web/source/dom/domManager.ts @@ -1244,8 +1244,10 @@ namespace com.keyman.dom { const osk = this.keyman.osk; if(osk) { if(this.lastActiveElement == null && this.activeElement == null) { - if(this.keyman.osk.activeTarget) { - this.keyman.osk.activeTarget = null; + // Assigning to the property does have side-effects. + // If the property is already unset, it's best to not unset it again. + if(osk.activeTarget) { + osk.activeTarget = null; } this.keyman.osk.hideNow(); // originally from a different one, seemed to serve the same role? } diff --git a/web/source/osk/oskView.ts b/web/source/osk/oskView.ts index 137dedfdc9..f02aba56e1 100644 --- a/web/source/osk/oskView.ts +++ b/web/source/osk/oskView.ts @@ -20,7 +20,7 @@ namespace com.keyman.osk { export enum ActivationMode { static = "static", // For use by documentation keyboards, eventually. manual = "manual", - conditional = "conditional" + automatic = "automatic" } export abstract class OSKView { @@ -75,7 +75,7 @@ namespace com.keyman.osk { private needsLayout: boolean = true; // - private _activationMode: ActivationMode = ActivationMode.conditional; + private _activationMode: ActivationMode = ActivationMode.automatic; private _displayIfActive: boolean = true; private _animatedHideTimeout: number; @@ -205,7 +205,7 @@ namespace com.keyman.osk { */ get activationMode(): ActivationMode { if(!this._activationMode) { - this._activationMode = ActivationMode.conditional; + this._activationMode = ActivationMode.automatic; } return this._activationMode; @@ -764,7 +764,7 @@ namespace com.keyman.osk { } if(!this._Box) { - return; + return false; } return true;