Multiple inputs in IE11
Running your fiddle for multiple inputs in IE11, one has to click (touch) a second time the input field to get the keyboard (while swiching the input fields, not the first focus).
It's the multiple inputs fiddle in your How-to in your wiki (https://jsfiddle.net/Mottie/9t1nrrbh/) Seems like a bug in IE11 (only tested on IE "11", works great in other browsers). Workaround is to give focus on click event (https://jsfiddle.net/9t1nrrbh/9/)
Hope this is the right place to report. BR
Hi @checkin247!
Thanks for reporting this problem and providing a work around! I'll investigate.
@Mottie is this bug solved yet?
for those of you who use angular put this directive on your element:
angular.module('focus-input', [])
.directive('focusInput', focusInputDirective);
function focusInputDirective() {
return {
restrict: "A",
link: linkFn
};
function linkFn(scope, elem, attrs) {
debugger;
elem.on("click", setFocus);
function setFocus() {
elem.focus();
}
scope.$on("$destroy", function () {
elem.off("click", setFocus);
})
}
}
Hi @ha0x7c7!
Sorry, I've been too distracted/busy to look into this further. I'll try to find some time this week.
@Mottie any update on this?
Sorry no, not yet 😞
how should we tackle this problem? I would like to help if I know where to start !
I just modified and tried the demo again (in IE11 of course)... clicking on the input appears to focus and open the keyboard without any problems.
I actually wonder if the code at line 718 (the blur) is causing the problem:
base.bindFocus = function() {
if (o.openOn) {
// make sure keyboard isn't destroyed
// Check if base exists, this is a case when destroy is called, before timers have fired
if (base && base.el.active) {
base.$el.bind(o.openOn + base.namespace, function() {
base.focusOn();
});
// remove focus from element (needed for IE since blur doesn't seem to work)
if ($(":focus")[0] === base.el) {
base.$el.blur();
}
}
}
};
Would you be willing to test it with this line removed?... since I can't reproduce the problem.
@Mottie Yes with pleasure (I will check it tomorrow ) ! I only remove that if clause? so what is the replacement for this? what does that comment says though?
If I remember correctly, IE used to maintain focus on the original input even after the keyboard opened and focus was supposed to be on the preview... remove that line and you should not need to replace it with anything.
Did removing that code fix the problem?
Sorry man for being late, we have released a major version to production and the code should kind of be untouched! maybe in next patch I will have a look at it.
On Fri, Aug 18, 2017 at 7:10 AM, Rob Garrison [email protected] wrote:
Did removing that code fix the problem?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Mottie/Keyboard/issues/541#issuecomment-323244580, or mute the thread https://github.com/notifications/unsubscribe-auth/AKYCFxTB55KjJ8sJweBfuCyiBrXlN5Lcks5sZPmVgaJpZM4MqUyA .