I have a problem when a user selects a text box in a form and then scrolls - a huge gap appears at the bottom of the screen. See image… (there is a LOT above this on the page)
That I can live with, but now the entire page has been moved up by that much so when the user goes back to the top of the form - they get bounced back see image… (this is the absolute highest I can go)
This wasn’t a problem a couple of ionic versions ago but I had to upgrade because some checkboxes weren’t staying open. Is there some way to recalculate the page height and reset it? When I move to another tab and then back again its perfect (but I loose all the data in my model)
EDIT: Steps to reproduce:
The problem seems to happen when you click on a text box and then
the app scrolls to it. To do this the textbox needs to be lower than
the top of the screen as seen in the next image (I clicked on
general comments)
2.Then the screen move to focus on it like so. I clicked on done:
3.Then you notice the gap that has been created at the bottom
4.To see how far it went I scrolled down
5.Then I scrolled back up. The maximum I could go was this
6.It should have been this
Sorry for all the images but sometimes its just easier to see a problem!
Fiddled right around with the settings there including full screen (which I tried on its own first) and still no luck. My current config.xml’s settings are now:
Is there anything else that I could have done to cause this? Its a very long form but I haven’t done too much trickery anywhere. I also just updated to the latest release and it hasn’t resolved the issue.
I guess this comes back to is there anyway to recalculate the height programmatically? I might be wrong but it feels like a JS layout thing
This piece of code from ionic-bundle.js describes exactly what causes the problem… We might be on to something
//If the element is positioned under the keyboard...
if (elementDeviceTop + elementHeight > deviceHeight) {
//Put element in middle of visible screen
self.scrollTo(0, elementScrollTop + elementHeight - (deviceHeight * 0.5), true);
}
Just for anyone else who comes across this problem, I wasn’t able to nut out a solution. My client was happy with creating a second screen which actually solved the problem quite elegantly as it was a pretty long form.