问题
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