Disabled editor auto-complete for Chrome for Android
authorAlexander Ebert <ebert@woltlab.com>
Sun, 18 Sep 2016 16:14:59 +0000 (18:14 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 18 Sep 2016 16:15:04 +0000 (18:15 +0200)
wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabCaret.js

index 351c3ef0459a5298ea80d1f01478a9e9d8eb0c0b..0a6c98a33313d8aee9efdf656801e35eb8b6d2b8 100644 (file)
@@ -17,6 +17,17 @@ $.Redactor.prototype.WoltLabCaret = function() {
                        this.$editor[0].addEventListener(WCF_CLICK_EVENT, this.WoltLabCaret._handleEditorClick.bind(this));
                        
                        this.WoltLabCaret._initInternalRange();
+                       
+                       require(['Environment'], (function (Environment) {
+                               if (Environment.browser() === 'chrome' && Environment.platform() === 'android') {
+                                       // Chrome for Android exposes falsified keyboard event data, causing
+                                       // quite a few issues with keystrokes such as backspace. Turning off
+                                       // auto-complete works around the issue for now.
+                                       // 
+                                       // https://bugs.chromium.org/p/chromium/issues/detail?id=118639
+                                       elAttr(this.$editor[0], 'autocomplete', 'off');
+                               }
+                       }).bind(this));
                },
                
                paragraphAfterBlock: function (block) {