Keyboard comes up and go down immediately


#1

This is my controller’s function to give focus to a specific input to have the keyboard come up and write on it.

$scope.focusToKeyboard = function(){
	jQuery('.map-post-box').focus();
	//jQuery('#map-post-input').trigger("focus");
	
	console.log("keyboard up!!");
};

as well as element below,

<!-- Posting ng-disabled='!isCanPost'-->
    <form ng-controller='PostsCtrl' name='postForm' ng-submit='addPost()' novalidate>
      <input type='text'  
          ng-model='content'
          ng-focus='moveToPostLocation()' 
          maxlength='38' 
          class='map-post-box'
          id='map-post-input'
          placeholder='what will happen today?' autocorrect="off" required>
          
      <!--
      <button ng-disabled='postForm.$invalid'
          ng-click='addPost()' 
          class="map-post-box button button-small button-assertive" 
          id='map-btn-submit'> 
          {{ isInstant(timevalue) && 'Instant' || (timevalue | date:"mm : ss") }} 
      </button>
      -->
    </form>

somehow the keyboard comes up and go down immediately…


#2

Use this directive: Auto-focus Textbox while template loads


#3

I guess it won’t work for iOS?

Showing keyboard not supported in iOS due to platform limitations.


#4

Unfortunately, I don’t know; I’m too lazy to try it on my Mac. It sits closed in my wardrobe. I know that you can’t use Ionic keyboard plugin to programmatically open a keyboard in iOS environment but focus alone should do it.

Though I can tell you it works on Android devices, I tried that successfully.