ios键盘关闭界面复原

126 阅读1分钟
public inputBlur() {
    if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
      setTimeout(() => {
        const scrollHeight = document.documentElement.scrollTop || document.body.scrollTop || 0
        window.scrollTo(0, Math.max(scrollHeight - 1, 0))
      }, 100)
    }
  }