安卓输入框调起键盘后输入框自动上浮


if (/Android [4-6]/.test(navigator.appVersion)) {
window.addEventListener('resize', function () {
if (document.activeElement.tagName === 'INPUT' || document.activeElement.tagName === 'TEXTAREA') {
window.setTimeout(function () {
document.activeElement.scrollIntoViewIfNeeded()
}, 0)
}
})
}
原文地址:https://www.cnblogs.com/vonson/p/5914148.html