监听input弹窗滚动到可视区域

This commit is contained in:
pangxingyue
2021-03-11 17:33:35 +08:00
parent 2466355d0e
commit 7b3fb33a24
2 changed files with 9 additions and 9 deletions

View File

@@ -103,7 +103,15 @@ permission()
//ios点击300毫秒时延
FastClick.attach(document.body)
// 监听input弹窗滚动到可视区域
window.addEventListener('resize', function () {
if (document.activeElement.tagName === 'INPUT' || document.activeElement.tagName === 'TEXTAREA') {
console.log('asdasdaaaaaaaaaaaa======================')
window.setTimeout(function () {
document.activeElement.scrollIntoViewIfNeeded()
}, 0)
}
})
Vue.config.productionTip = false
new Vue({
router,