1

I have wrote an angular code for showing a virtual keyboard using angular-virtual-keyboard, The code is working fine and the virtual keyboard is coming fine when we click the text-field. The issue is that I want the virtual keyboard to be shown as directly in the page and not by any click.

How we can achieve this.

Can anyone please help me on this, do we have any other component in angularjs which supports virtual keyboard

My code is as given below

Working Demo

<div ng-app='myApp' ng-controller="Controller">
    Click this textfield to see the Virtual Keyboard<br/><input type='text' ng-model="yourModel" ng-virtual-keyboard/>
</div>

1 Answer 1

2

I updated the fiddle with the answer: http://jsfiddle.net/bujvs55h/1/

Just add this directive:

app.directive('autoFocus', function($timeout) {
    return {
        restrict: 'AC',
        link: function(_scope, _element) {
            $timeout(function(){
                _element[0].focus();
            }, 0);
        }
    };
});
Sign up to request clarification or add additional context in comments.

5 Comments

thanks for the answer, the thing is that I want the virtual keyboard to be displayed in the webpage as always not that it should come when we click the textfield
It comes out when you load the page, you haven't to click anything.
but its going off when I click some where
oh well, if you want to be sticked you should ask the module's author
ooh...do we have any component like that in angularjs

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.