if (document.activeElement && /Android [4-6]/.test(navigator.appVersion)) {
window.addEventListener('resize', function () {
var tagName = document.activeElement.tagName.toUpperCase();
if (tagName === 'INPUT' || tagName === 'TEXTAREA') {
window.setTimeout(function () {
document.activeElement.scrollIntoViewIfNeeded();
}, 100)
}
});
}
转载于:https://www.cnblogs.com/daiwenru/p/7649072.html