solution that input label was hidden by keyboard in WeChat of iPhone

参考这里

遮挡问题主要出现在apple,场景:微信和百度网盘的webkit不一样,此处展示微信.

//the 1000 means that it should be reset after the native keyboard appears.
$('input').on('focus',function(event){
        //自动反弹 输入法高度自适应
        var target = this;
        setTimeout(function(){
            // target.scrollIntoViewIfNeeded();the method doesn't work in wechat
            // false:与input底部对齐;true:与input顶部对齐,微信里比较怪,各种不奏效。
            // How lucky and fortunate it can be work! Nearly crying for the tip.
            target.scrollIntoView(true)
        },1000);
    });        

Notice: If you face the same problem, do not betray the belief that built by yourself, which is that you are a engineer other than a programmer. The solution can solve some problems till now, but the source is communication and design(not designers, just their thoughts). People creat the problem, and find the solution. I don't think that is the best and marvelous solution which can stop the noisy. The right way maybe is that creating a standard principle which should be followed and W3C organization is doing. Unfortunately, following it is just a dream. What a pity.

posted on 2017-07-13 17:01  鸣动我心  阅读(130)  评论(2编辑  收藏  举报