Android - html input loses focus when soft keyboard opens (ASP.net)

后端 未结 6 1641
梦谈多话
梦谈多话 2020-12-10 02:05

I\'ve written a web-page login form in ASP.net.

Using a Nexus 4, stock Android 4.2.1, native Chrome browser - when I click on the fields,

6条回答
  •  囚心锁ツ
    2020-12-10 02:23

    I have find other solution

    First you have to create a function

    function getFocus(campo){
        $(window).bind('resize', function() {
            if(windowWidth <= 1025) {
                $(campo).focus();
            }
        }); 
    
    }   
    

    and when you click in an input you call the function

    $('input').click(function(){
        getFocus(this); 
    });
    

    This works for me

提交回复
热议问题