Question

I have seen many examples on how to get iPhone keyboard popup to change its input form, however I would like to have my input field to be a part of the iPhone keyboard popup

whenever I have an input field then the keyboard pops up and pushes the input field - inorder to have the input field "follow" the keyboard, then it must somehow be "embedded" -- I have seen solutions capable of this, however I have seen no javascript code

Is it possible to use javascript to get an input field to be a part of the keyboard or at least follow it precise ?

Was it helpful?

Solution

One way of doing this without dealing with objective-c is to set the inputs styling to scroll up with the keyboard in css. Although its kinda a hacky solution here is what I used to style the input to scroll up with the keyboard:

input{
            position:absolute;
            bottom:-16px;
            width: 100%;
            left:0;
            height: 5%;
            padding:0;
            margin:0;
        }

Since the bottom of the window changes when the keyboard comes up the inputs position will also change with it. You can obviously add to this to make it more fancy, but hopefully you get the idea.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top