Default phone feature: When an input is focused on a mobile device, it automatically scrolls to that input.
Issue: This functionality is not working in my ionic app due to horizontal scrolling. Consequently, when I tap on an input, it does not scroll to it automatically and the input gets hidden behind the keyboard.
I attempted to use delegate-handle
to solve this problem, but it did not work as expected.
Here's the Plunker for reference.
HTML
<ion-scroll direction="xy" class="scroll" delegate-handle="nomineeDiv">
<div class="table-row" ng-repeat="data in nominee"><!-- Several divs displayed horizontally -->
<form name="data.formName">
<!-- Lengthy vertical form
.....
.....
after 4 input tags -->
<input type="text" name="something"/>
<!-- Focus should trigger scrolling to this input -->
</form>
</div>
</ion-scroll>
Controller
$ionicScrollDelegate.$getByHandle('nomineeDiv').scrollBy(580, 140, true);