解决ios点击弹出键盘后,页面位置不恢复
<input name="patientId" class="input-line" placeholder="点此填写"@blur.prevent="changeBlur"/>changeBlur(){var u = navigator.userAgent, app = navigator.appVersion;...
·
<input name="patientId" class="input-line" placeholder="点此填写" @blur.prevent="changeBlur"/>
changeBlur(){
var u = navigator.userAgent, app = navigator.appVersion;
var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
if(isIOS){
setTimeout(function () {
const scrollHeight = document.documentElement.scrollTop || document.body.scrollTop || 0
window.scrollTo(0, Math.max(scrollHeight - 1, 0));
}, 200)
} }
更多推荐
已为社区贡献1条内容
所有评论(0)