移動端input框問題

部分問題可參考:https://www.cnblogs.com/ljx20...html

失焦以後webview沒有回到原來位置

input.addEventListener('blur', () => {
    setTimeout(() => {
        window.scrollTo(document.body.scrollLeft, document.body.scrollTop);
    }, 20)
})

不聚焦問題

若是引入了fastclick,那麼須要修改源碼,以下web

FastClick.prototype.focus = function(targetElement) {
    targetElement.focus();
};

若是還有問題,嘗試監聽input的focus,而後延時聚焦this

this.jInput.addEventListener('focus', () => {
    setTimeout(() => {
       this.jInput.focus()
   }, 300)
})

若是沒有引入fastclick,網上找其餘緣由吧,還沒遇到過prototype

相關文章
相關標籤/搜索