Question: Automatic scrolled into view of focus input

Question

Automatic scrolled into view of focus input

Answers 0
Added at 2016-12-27 19:12
Tags
Question

How to enable automatic scroll to focus input when keyboard are open ? I create a simple demo where are 2 inputs:

<div style="height:300px;"></div>
<form action="/">
   <input type="text" />
   <br/>
   <input type="text" /> 
   <button>ok</button>
</form>
<div style="height:300px;"></div>

When I click on input in the bottom on the page, keyboard open and hide input. example

I open from my phone w3s site ant on them when I click on input when it of the bottom of the page browser automatically scrolled it into view. w3s site

What I need to do that automatic scroll into view of focus input will start work on my demo ?

Answers
Source Show
◀ Wstecz