关于移动端input框获取焦点后被键盘遮盖问题修复的最佳方案
Android真机测试通过 ✔iOS真机测试通过 ✔// input 键盘焦点问题修复window.addEventListener('resize', () => {const activeElement = document.activeElementif (activeElement.tagName === 'INPUT' || activeEleme...
·
- Android真机测试通过 ✔
- iOS真机测试通过 ✔
// input 键盘焦点问题修复
window.addEventListener('resize', () => {
const activeElement = document.activeElement
if (activeElement.tagName === 'INPUT' || activeElement.tagName === 'TEXTAREA') {
setTimeout(() => {
activeElement.scrollIntoView()
}, 100)
}
})
更多推荐
所有评论(0)