遇到H5頁面-input 彈起鍵盤遮蓋輸入框(Android),鍵盤頂不起來輸入框,
用js的resize()方法對瀏覽器窗口調整大小進行計數:覽器窗口的大小時,發生 resize 事件。就可以解決
window.addEventListener('resize', () => {
if (document.activeElement.tagName == 'INPUT') {
window.setTimeout(() => { document.activeElement.scrollIntoViewIfNeeded();
}, 100);
}
})
轉自:https://blog.csdn.net/weixin_43549408/article/details/84986323