IOS Safari/Chrome How to remove unwanted scroll to focus input/textarea when a page with input/texarea is opened

javascript
ios
#1

I'm developing a responsive web site for promoting natural attractions. On PC and Android phones, everything works fine, but on IOS, when a new page is opened, it is scrolling, automatically, to the bottom, where a form (1 input, 1 textarea) become focused.(by default in IOS).

How can I remove this behavior? Normal behavior: When page is opened, it should remain top, no scroll is necessary to the bottom of page, where it's displayed form.

Step to reproduce (on IOS, Iphone or Ipad): Open http://app.banatul-montan.ro/ click on a marker. The page is opening and is scrolling down to focus element. Moreover, I added a scrollToTop function after 1 seconds delayed. With this workaround, the page is flickering, scrolling down and scrolling up to normal position.

0 Likes

#2

Maybe this will help https://stackoverflow.com/questions/11064237/prevent-iphone-from-zooming-form (user-scalable=0)?

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/>

0 Likes

closed #3

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.

0 Likes