When using a complex ionicPopup with a single input field, the form is pushed off the screen due to the auto-focus on the input element opening the native keyboard in iOS.
Form is pushed partly of screen with keyboard open on auto-focus:
However, if I modify ionic.bundle.js such that there is no auto-focus selection in the pop-up, and then I bring focus to the field, the pop-up form auto-scrolls to a much more suitable position.
Change to ionic.bundle.js:
function focusInputOrButton(element) {
var focusOn = element[0].querySelector('input[autofocus]');
// if (!focusOn) {
// focusOn = element[0].querySelector('input');
// if (!focusOn) {
// var buttons = element[0].querySelectorAll('button');
// focusOn = buttons[buttons.length-1];
// }
// }
if(focusOn) {
focusOn.focus();
}
}
No auto-focus so keyboard does not open:
Bring focus to input field and complete form is visible:
Is there anyway to change the auto-scroll such the form stays in view correctly?