diff --git a/web/source/kmwnative.ts b/web/source/kmwnative.ts index 40b06d7253..6bf7c3e949 100644 --- a/web/source/kmwnative.ts +++ b/web/source/kmwnative.ts @@ -30,7 +30,7 @@ if(!window['keyman']['initialized']) { */ keymanweb.setDefaultDeviceOptions = function(opt : com.keyman.OptionType) { // Element attachment type - if (opt['attachType'] == '' || opt['attachType'] === undefined) { + if (!opt['attachType']) { opt['attachType'] = (device.touchable ? 'manual' : 'auto'); } } diff --git a/web/testing/attachment-api/index.html b/web/testing/attachment-api/index.html index 0616d5f0bd..37cb68476c 100644 --- a/web/testing/attachment-api/index.html +++ b/web/testing/attachment-api/index.html @@ -41,12 +41,9 @@ var attachText = attachType ? attachType : "default"; var kmw=window.keyman; - if (attachType) { - kmw.init({ - attachType: attachType}); - } else { - kmw.init({}); - } + kmw.init({ + attachType: attachType ? attachType : '' + });