web - ios网页开发中 如果使用第三方输入法 如搜狗 点击input输入的时候不上推 怎么破
阿神
阿神 2017-04-17 14:54:57
0
3
650

ios网页开发中 如果使用第三方输入法 如搜狗 点击input输入的时候不上推 怎么破

阿神
阿神

闭关修行中......

reply all(3)
伊谢尔伦

You can use scrollY to determine whether the pop-up is a third-party keyboard (the third-party keyboard referred to here is mainly a keyboard that cannot be pushed up automatically). Because it is not pushed up, the value of scrollY is very low. After actual testing, it will not exceed 10

So, it can be done with a simple 5-6 lines of code

  • If it is a native keyboard that can be pushed up or other third-party keyboard that can be pushed up, it will not be processed

  • If it cannot be pushed up, use the scrollTo method to reach a limit value and pull it up

Three constants can be set to:

SCROLLY=100;
TIMER_NAME=500 // Judge after 500ms in focus event
MAX_SCROLL=99999 // The bigger, the better

setTimeout(function() {
      if(window.scrollY < SCROLLY) {
        window.scrollTo(0, MAX_SCROLL);
      }
    }, TIMER_NAME)
迷茫

Find feedback from Sogou customer service.

洪涛

According to my experience in development, you can only handle it yourself. When you get focus, animate upwards, and when you lose focus, animate downwards.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template