# Element focus not showing keyboard on IOS

**URL:** <https://forum.ionicframework.com/t/element-focus-not-showing-keyboard-on-ios/21176>\
**Category:** uncategorized\
**Created:** [April 17, 2015, 11:45am UTC](https://forum.ionicframework.com/t/element-focus-not-showing-keyboard-on-ios/21176 "2015-04-17T11:45:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![CT14\_IT](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/ct14_it/32/65350_2.png) [@CT14\_IT](https://forum.ionicframework.com/u/CT14_IT)\
**Post date:** [April 17, 2015, 11:45am UTC](https://forum.ionicframework.com/t/element-focus-not-showing-keyboard-on-ios/21176/1 "2015-04-17T11:45:29Z")

</div>

I’ve got a simple directive that focuses on the next input when enter is pressed. This works in my browser via `ionic serve` and it works when deployed on my Android Nexus 5, however it seems element isn’t correctly focuses on an iPhone/iPad.

Here is my (crude) directive

```
emfApp.directive('chain', [ function() {
	return {
		restrict: 'A',
		require: ['ngModel'],
		link: function(scope, element, attrs, ctrls) {
			element.bind('keydown', function(e) {
				var code = e.keyCode || e.which;
				if (code === 13) {
					e.preventDefault();
					var inputs = document.querySelectorAll('input');
					for(var i = 0; i < inputs.length; i++){
						if(inputs[i] == element[0]){
							if(i+1 < inputs.length){
								inputs[i+1].focus();
								break;
							}
					 	}
					 }

				}
			});
		}
	}
}]);

```

I know this isn’t an Ionic issue and I think it’s intentional on Safari’s part to prevent the keyboard taking over, but I would still like to be able to perform this action.

Any tips? 😄

Thanks
