언어 설정

Menu
Sites
Language
when enter text in text field then emulator key board apper and push all the element upward

Hi,

I have develop an application in which when i enter the text in text field then emulator key board appers and it push the element of screen upward.

How i can resolve this please help me.

 

 

 

thanks and regards

mohit kumar

 

Responses

3 댓글
Palitsyna

Hello,

It is standard behaviour of input field. As far as I know, in Web Applications Virtual Keyboard associated with "input" or "textarea" tags and should be shown on focus event. It also scrolls elements up in order not to cover focused input field.

 

Regards,

Svetlana Palitsyna

pius lee

I think your problem need more information like HTML source.

Anyway, unwanted moved HTML elements at keyboard appear is known issues.

you could check this article.

http://stackoverflow.com/questions/14492613/ios-ipad-fixed-position-breaks-when-keyboard-is-opened

 

Seoghyun Kang

Hello,

 

I agree with Palitsyna's opinion.

But you can move the scroll position. BTW, I do not recommend this way :)

 

Firstly, you should add the event listener to the input field.

document.querySelector('#strText').addEventListener('blur', scrollDown);
document.querySelector('#strText').addEventListener('focus', scrollDown);

 

Then, please move the scroll. The following code is a sample.

function scrollDown(){
    setTimeout(function(){
        var elem = document.getElementById('scrollBoard');
        elem.scrollTop = elem.scrollHeight;
    }, 400);
}

Depending on your situation, please use this method. But as my comment, I think it is not good way.

Thanks