Fixed input focus issue on iOS/Android
authorAlexander Ebert <ebert@woltlab.com>
Fri, 25 Sep 2015 11:11:41 +0000 (13:11 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 25 Sep 2015 11:11:41 +0000 (13:11 +0200)
wcfsetup/install/files/js/WCF.Poll.js

index 9c8f82257db93d697de931119db5807a64d82deb..0a4b6847e5a6527f9ec3015f6997f9db218d8803 100644 (file)
@@ -120,6 +120,12 @@ WCF.Poll.Management = Class.extend({
                
                // insert input field
                var $input = $('<input type="text" value="' + optionValue + '" maxlength="255" />').css({ width: this._inputSize + "px" }).keydown($.proxy(this._keyDown, this)).appendTo($listItem);
+               $input.click(function() {
+                       // work-around for some weird focus issue on iOS/Android
+                       if (document.activeElement !== this) {
+                               this.focus();
+                       }
+               });
                
                if (insertAfter !== null) {
                        $input.focus();