CSS - Chrome Mobile - Page move up when keyboard appears

假如想象 提交于 2021-02-10 18:41:55

问题


I implemented a web page with ReactJS, I have a form with some fields, in Chrome for computers it works ok, but when I go in the form using a mobile like a Tablet or Smartphone, when the keyboard appears all the page move to up and the menu of my page is hiden by the navigation bar of the Chrome navigator.

Here is the flow:

I have the next meta in the head:

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, shrink-to-fit=no"
    />

The problem only happens in chrome for mobile devices.


回答1:


If I had to guess, I would say that you have a margin-top or a a padding-top set with relative units like vh. I think of this because when the keyboard appears, the viewport will be reduced and these units will ajust themselves, making these kind of situations.



来源:https://stackoverflow.com/questions/57479093/css-chrome-mobile-page-move-up-when-keyboard-appears

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!