diff --git a/web/source/kmwembedded.ts b/web/source/kmwembedded.ts index 3e44a94932..aa44bfbcfa 100644 --- a/web/source/kmwembedded.ts +++ b/web/source/kmwembedded.ts @@ -40,7 +40,7 @@ namespace com.keyman.osk { } }; - // iOS now relies upon native-mode popup key management, so we only implement these hybrid-targetted + // iOS now relies upon native-mode popup key management, so we only implement these hybrid-targeted // methods when embedding in Android. let device = com.keyman.singleton.util.device; @@ -56,10 +56,8 @@ namespace com.keyman.osk { if(key['subKeys'] && (typeof(window['oskCreatePopup']) == 'function')) { var xBase = dom.Utils.getAbsoluteX(key) - dom.Utils.getAbsoluteX(this.kbdDiv) + key.offsetWidth/2, yBase = dom.Utils.getAbsoluteY(key); - - if(util.device.formFactor == 'phone') { - this.prependBaseKey(key); - } + + // #3718: No longer prepend base key to subkey array this.popupBaseKey = key; this.popupPending=true; diff --git a/web/source/osk/visualKeyboard.ts b/web/source/osk/visualKeyboard.ts index 8f80edaa17..7d53f4c9d2 100644 --- a/web/source/osk/visualKeyboard.ts +++ b/web/source/osk/visualKeyboard.ts @@ -1509,10 +1509,7 @@ namespace com.keyman.osk { subKeys.id='kmw-popup-keys'; this.popupBaseKey = e; - // Does the popup array include the base key? *** condition for phone only *** - if(device.formFactor == 'phone') { - this.prependBaseKey(e); - } + // #3718: No longer prepend base key to popup array // Must set position dynamically, not in CSS var ss=subKeys.style; @@ -1599,43 +1596,7 @@ namespace com.keyman.osk { } } - /** - * Prepend the base key to the touch-hold key array (for phones) - * - * @param {Object} e base key object - */ - prependBaseKey(e: KeyElement) { - // This is a tag we set on the key element during its construction. - let subKeys: OSKKeySpec[] = e['subKeys']; - let keyman = com.keyman.singleton; - if(e && typeof(e.id) != 'undefined') { - //TODO: refactor this, it's pretty messy... - var i, - idx = e.id.split('-'), - baseId = e['keyId'], - layer = e['key'].spec['layer'], - sp = e['key'].spec['sp'], - nextlayer = e['key'].spec['nextlayer']; - - if(typeof subKeys != 'undefined' && subKeys.length > 0 && (subKeys[0].id != baseId || subKeys[0].layer != layer)) { - var eCopy = new OSKKeySpec(baseId, '', undefined, sp, nextlayer); // {'id':baseId,'layer':'','key':undefined}; - if(layer != '') { - eCopy['layer'] = layer; - } - - for(i = 0; i < e.childNodes.length; i++) { - if(keyman.util.hasClass( e.childNodes[i], 'kmw-key-text')) { - break; - } - } - if(i < e.childNodes.length) { - eCopy['text'] = e.childNodes[i].textContent; - } - subKeys.splice(0, 0, eCopy); - } - } - } //#endregion /** @@ -2605,4 +2566,4 @@ namespace com.keyman.osk { return false; }; } -} \ No newline at end of file +}