Any way to detect home button pressing on HTML5?

Alright, I’ve been trying to go around limitations on the INPUT field on HTML5 - namely the way the window scrolls up no matter where the input field is, including when it’s at the top, making it go away from the view. I am moving the content down anytime the input is focused, and moving it back when something else is focused (touched).

The thing is, if the home button is pressed and later the user comes back, the keyboard goes away but the contents stay where they were (i.e. moved down). If there was a way to detect the home button pressing I could move the content back where it was…

If anyone has other ideas to make the input textfield stay on the screen when the keyboard shows up on an iPad… that would be a way of fixing this.

Thanks everyone.

Maybe you can force the keyboard to come back by giving focus on the text input? I think this option exists in native apps.

In native apps there shouldn’t be issues with the input, as far as I understand it’s only crappy in HTML5. The thing is that for N other reasons I’m kinda forced to use that target.

Anyway, I could either try to force the keyboard back or move the content, but I do need to know if the home button was pressed first. This is the issue.

I’ve found the answer for this:

A simple Lib.getTimer() can tell if the page has been inactive (i.e. in the background). I’m using that to trigger a reset on the content position.

1 Like

Do you get any stage focus events, like stage DEACTIVATE or FOCUS_OUT?