From c13194a3887f8cc3538de6e2971e44e8a5618851 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Tue, 17 Jan 2017 17:48:19 +0100 Subject: [PATCH] Work-around for word-duplication in Chrome for Android --- .../js/3rdParty/redactor2/plugins/WoltLabKeydown.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabKeydown.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabKeydown.js index 59e4138e46..3b5ff3740e 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabKeydown.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabKeydown.js @@ -57,6 +57,16 @@ $.Redactor.prototype.WoltLabKeydown = function() { } }).bind(this); + var ua = window.navigator.userAgent.toLowerCase(); + if (ua.indexOf('linux') !== -1 && ua.indexOf('android') !== -1 && ua.indexOf('chrome') !== -1) { + // prevent the word duplication issue on Chrome for Android, + // caused by the call to buffer.set() during backspace + this.keydown.checkEvents = (function() { + // also discard the previous existing click event + this.core.addEvent(false); + }).bind(this); + } + // rebind keydown event this.core.editor().off('keydown.redactor'); this.core.editor().on('keydown.redactor', this.keydown.init.bind(this)); -- 2.20.1