From 09d3fff59da5bfc3f0781acddd54a05fa0015cbe Mon Sep 17 00:00:00 2001 From: cpsdqs Date: Tue, 19 Sep 2017 07:21:34 +0200 Subject: [PATCH] =?UTF-8?q?Make=20input=20=F0=9D=98=AC=F0=9D=98=AA?= =?UTF-8?q?=F0=9D=98=AF=F0=9D=98=A5=F0=9D=98=A2=20work=20with=20Firefox=20?= =?UTF-8?q?mobile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/soft_keyboard.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/js/soft_keyboard.js b/js/soft_keyboard.js index 2acfebe..c1a37ab 100644 --- a/js/soft_keyboard.js +++ b/js/soft_keyboard.js @@ -82,8 +82,12 @@ module.exports = function (screen, input) { keyInput.addEventListener('input', e => { e.stopPropagation() - if (e.isComposing) { + if (e.isComposing && 'data' in e) { sendInputDelta(e.data) + } else if (e.isComposing) { + // Firefox Mobile doesn't support InputEvent#data, so here's a hack + // that just takes the input value and uses that + sendInputDelta(keyInput.value) } else { if (e.inputType === 'insertCompositionText') input.sendString(e.data) else if (e.inputType === 'deleteContentBackward') {