Input focus when animation is done

On Android using focus() does not popup the keyboard. I managed to make it work by adding a softkeyboard plugin.

Softkeyboard plugin

Steps:

  • In CMD on Windows navigate to the root of your project.

  • Enter the command “cordova plugin add org.apache.cordova.plugin.softkeyboard”

  • Modify the directive

    .directive(‘focusMe’, function($timeout) {
    return {
    link: function(scope, element, attrs) {
    $timeout(function() {
    element[0].focus();
    cordova.plugins.SoftKeyboard.show();
    },750);
    }
    };
    });

1 Like