From 74353e43f5d9f8db5795279ee8548d2a1731cc79 Mon Sep 17 00:00:00 2001 From: jahorton Date: Tue, 11 Feb 2020 08:47:36 +0700 Subject: [PATCH] fix(web): patches Float and Toggle UI issues. Fixes #2595 --- web/source/kmwuifloat.ts | 4 ++-- web/source/kmwuitoggle.ts | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/web/source/kmwuifloat.ts b/web/source/kmwuifloat.ts index c3dc1b0d00..69a7c54e78 100644 --- a/web/source/kmwuifloat.ts +++ b/web/source/kmwuifloat.ts @@ -127,7 +127,7 @@ if(!window['keyman']['ui']['name']) { // Check required interface alignment and default keyboard var opt=util['getOption']('ui'),dfltKeyboard='English'; - if(typeof(opt) == 'object') + if(opt && typeof(opt) == 'object') { if(typeof(opt['position']) == 'string' && opt['position'] == 'right') ui.floatRight = true; @@ -484,7 +484,7 @@ if(!window['keyman']['ui']['name']) { keymanweb['addEventListener']('controlfocused', function(params) { - if(params['activeControl'] == null || params['activeControl']['LEnabled']) + if(params['activeControl'] == null || params['activeControl']['_kmwAttachment']) { /*if(keymanweb._IsIEEditableIframe(Ltarg)) Ltarg = Ltarg.ownerDocument.parentWindow.frameElement; diff --git a/web/source/kmwuitoggle.ts b/web/source/kmwuitoggle.ts index a5926fb1d4..6f1efd3da7 100644 --- a/web/source/kmwuitoggle.ts +++ b/web/source/kmwuitoggle.ts @@ -596,6 +596,11 @@ if(!window['keyman']['ui']['name']) { _k.className='selected'; ui.selectedMenuItem=_k; } + // Occurs for desktop form-factors when no keyboard (aka the sys default) is active. + if(!ui.oskButton) { + return; + } + // Hide the OSK button for CJK keyboards (or non-mapped) if(lgCode=='cmn' || lgCode=='jpn' || lgCode=='kor') {