微信开发中苹果手机软键盘弹出,页面上移bug
<script> document.body.addEventListener("focusout", () => { //软键盘收起的事件处理 setTimeout(() => { const scrollHeight = document.documentElement.scrollTop || document.body.scrollTop || 0; window.scrollTo(0, Math.max(scrollHeight - 1, 0)); }, 100); }); </script>