Revert "feat: handle ios safari keyboard"

This reverts commit 9b31df28aa.
This commit is contained in:
Tim
2025-08-05 15:20:57 +08:00
parent 2c0d39a6b8
commit dc73a74e1c
2 changed files with 0 additions and 25 deletions

View File

@@ -1,23 +0,0 @@
export function initIOSKeyboardFix() {
if (typeof window === 'undefined' || !window.visualViewport) return;
const ua = navigator.userAgent || '';
const isIOS = /iP(ad|hone|od)/.test(ua);
if (!isIOS) return;
const viewport = window.visualViewport;
const adjustScroll = () => {
window.scrollTo(0, viewport.offsetTop);
};
viewport.addEventListener('resize', adjustScroll);
viewport.addEventListener('scroll', adjustScroll);
let lastScrollY = 0;
document.addEventListener('focusin', () => {
lastScrollY = window.scrollY;
});
document.addEventListener('focusout', () => {
window.scrollTo(0, lastScrollY);
});
}