Titouan de Bailleul Titouan de Bailleul - 2 months ago 16
HTML Question

Viewport shifted horizontally when textfield is focused

This is the issue I'm having when the textfield is focused in my Sencha Touch App

enter image description here

The textfield seems to be centered vertically and horizontally for some reason.

This is how it's supposed to look

enter image description here

Does anyone already have the same issue and solved it ?

Update

It does not happen all the time but does happen on any textfield that is not originally horizontally centered.

Does happen on Android sometimes as well (Chrome 26)

Answer

It was actually the Facebook <div> that you need to have in your index.html, which during the app requests was causing this issue. Like @rdougan said, it was larger than the screen and therefore the field was horizontally and vertically centered.

To solve this issue, I just hide the Facebook <div> after the app request has been sent and show it whenever I need it.

Comments