fix(odin): disable pull-to-refresh on the immersive mobile page
A PTR reload lands while the standalone-PWA viewport is still settling and re-races the --app-height measurement (Chromium settles without firing resize), bringing the scroll room back ~50% of the time. The immersive page is fixed-viewport, so overscroll-behavior-y: none on html+body removes the gesture (and the race trigger) entirely; restored on route leave. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -42,10 +42,19 @@ export default function AppShell() {
|
||||
set();
|
||||
window.addEventListener("resize", set);
|
||||
window.visualViewport?.addEventListener("resize", set);
|
||||
// Kill pull-to-refresh: a PTR reload lands mid-viewport-settle and
|
||||
// re-races the measurement (Chromium settles without a resize event).
|
||||
// The immersive page is fixed-viewport — the gesture has no use here.
|
||||
const prevRootOverscroll = root.style.overscrollBehaviorY;
|
||||
const prevBodyOverscroll = document.body.style.overscrollBehaviorY;
|
||||
root.style.overscrollBehaviorY = "none";
|
||||
document.body.style.overscrollBehaviorY = "none";
|
||||
return () => {
|
||||
window.removeEventListener("resize", set);
|
||||
window.visualViewport?.removeEventListener("resize", set);
|
||||
root.style.removeProperty("--app-height");
|
||||
root.style.overscrollBehaviorY = prevRootOverscroll;
|
||||
document.body.style.overscrollBehaviorY = prevBodyOverscroll;
|
||||
};
|
||||
}, [immersiveOnMobile]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user