Spaces:
Sleeping
Fix mobile horizontal scroll / rubber-band (iOS)
Browse filesThe page could be dragged/bounced left-right on iPhone even though no content
extends past the right edge (audited: scrollWidth==viewport in every state).
Cause: the off-canvas nav drawer (position:fixed; translateX(-100%)) sits
off-screen left, and the root had no horizontal-overflow / overscroll guard —
desktop Chrome clips it, iOS Safari lets you pan/rubber-band to it.
- overscroll-behavior-x:none on html,body (all viewports) — kills the
horizontal rubber-band. Safe: doesn't create a scroll container, so the
desktop sticky sidebar keeps working.
- overflow-x:hidden on html,body ONLY <=959px (mobile, where the sidebar is
a fixed drawer, not sticky) — clips stray horizontal overflow. NOT applied
globally because it breaks position:sticky (verified: it detached the
desktop sidebar).
- closed drawer => visibility:hidden (flips visible on open, hides after the
slide-out) so the fixed off-screen drawer can't be a pan/scroll target.
Verified: desktop sticky sidebar still sticks (top:0 after scroll); mobile has
no page h-overflow, drawer still opens. Cache-buster -> v=20260602-noxscroll2.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- dee/static/app.css +20 -2
- dee/static/index.html +2 -2
|
@@ -206,6 +206,11 @@ html, body {
|
|
| 206 |
-webkit-font-smoothing: antialiased;
|
| 207 |
text-rendering: optimizeLegibility;
|
| 208 |
font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 209 |
}
|
| 210 |
|
| 211 |
body { min-height: 100vh; }
|
|
@@ -3346,6 +3351,11 @@ body.sidebar-open .sidebar-scrim {
|
|
| 3346 |
}
|
| 3347 |
|
| 3348 |
@media (max-width: 959px) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3349 |
.app { grid-template-columns: 1fr; }
|
| 3350 |
|
| 3351 |
/* Sidebar = slide-in drawer from the left. Fixed positioning so it
|
|
@@ -3361,7 +3371,11 @@ body.sidebar-open .sidebar-scrim {
|
|
| 3361 |
max-width: 280px;
|
| 3362 |
z-index: 50;
|
| 3363 |
transform: translateX(-100%);
|
| 3364 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3365 |
box-shadow: var(--elev-4);
|
| 3366 |
padding-top: max(16px, env(safe-area-inset-top));
|
| 3367 |
padding-bottom: max(18px, env(safe-area-inset-bottom));
|
|
@@ -3370,7 +3384,11 @@ body.sidebar-open .sidebar-scrim {
|
|
| 3370 |
overflow-y: auto;
|
| 3371 |
-webkit-overflow-scrolling: touch;
|
| 3372 |
}
|
| 3373 |
-
body.sidebar-open .sidebar {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3374 |
|
| 3375 |
.nav-toggle { display: inline-flex; flex-shrink: 0; }
|
| 3376 |
|
|
|
|
| 206 |
-webkit-font-smoothing: antialiased;
|
| 207 |
text-rendering: optimizeLegibility;
|
| 208 |
font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
|
| 209 |
+
/* Kill the horizontal rubber-band everywhere (safe — doesn't establish a
|
| 210 |
+
scroll container, so it won't break the desktop sticky sidebar). The
|
| 211 |
+
actual horizontal CLIP is applied only on mobile below, because
|
| 212 |
+
overflow-x:hidden here WOULD break position:sticky. */
|
| 213 |
+
overscroll-behavior-x: none;
|
| 214 |
}
|
| 215 |
|
| 216 |
body { min-height: 100vh; }
|
|
|
|
| 3351 |
}
|
| 3352 |
|
| 3353 |
@media (max-width: 959px) {
|
| 3354 |
+
/* On mobile the sidebar is a fixed drawer (no sticky), so clipping
|
| 3355 |
+
horizontal overflow here is safe and stops any stray element — plus the
|
| 3356 |
+
off-canvas drawer — from letting the page pan/bounce sideways on iOS. */
|
| 3357 |
+
html, body { overflow-x: hidden; }
|
| 3358 |
+
|
| 3359 |
.app { grid-template-columns: 1fr; }
|
| 3360 |
|
| 3361 |
/* Sidebar = slide-in drawer from the left. Fixed positioning so it
|
|
|
|
| 3371 |
max-width: 280px;
|
| 3372 |
z-index: 50;
|
| 3373 |
transform: translateX(-100%);
|
| 3374 |
+
/* visibility:hidden when closed so the off-screen fixed drawer can't be
|
| 3375 |
+
a horizontal scroll/pan target on iOS; flips visible instantly on
|
| 3376 |
+
open and hides after the slide-out finishes (0s delay = --t-slow). */
|
| 3377 |
+
visibility: hidden;
|
| 3378 |
+
transition: transform var(--t-slow) var(--ease), visibility 0s linear var(--t-slow);
|
| 3379 |
box-shadow: var(--elev-4);
|
| 3380 |
padding-top: max(16px, env(safe-area-inset-top));
|
| 3381 |
padding-bottom: max(18px, env(safe-area-inset-bottom));
|
|
|
|
| 3384 |
overflow-y: auto;
|
| 3385 |
-webkit-overflow-scrolling: touch;
|
| 3386 |
}
|
| 3387 |
+
body.sidebar-open .sidebar {
|
| 3388 |
+
transform: translateX(0);
|
| 3389 |
+
visibility: visible;
|
| 3390 |
+
transition: transform var(--t-slow) var(--ease), visibility 0s linear 0s;
|
| 3391 |
+
}
|
| 3392 |
|
| 3393 |
.nav-toggle { display: inline-flex; flex-shrink: 0; }
|
| 3394 |
|
|
@@ -22,7 +22,7 @@
|
|
| 22 |
<!-- ?v= query bumps invalidate browser + iframe asset caches when app.css /
|
| 23 |
app.js change. Bump these numbers whenever you ship a frontend update —
|
| 24 |
without them, users keep getting the stale file for up to a week. -->
|
| 25 |
-
<link rel="stylesheet" href="/static/app.css?v=20260602-
|
| 26 |
<link rel="icon" type="image/svg+xml" href="/static/favicon.svg?v=2" />
|
| 27 |
<link rel="apple-touch-icon" href="/static/favicon.svg?v=2" />
|
| 28 |
<!-- Mol* (PDBe) viewer for AlphaFold structure embed. Loaded async; the
|
|
@@ -1176,6 +1176,6 @@
|
|
| 1176 |
<!-- Cloning reference data must load before app.js so the Designer
|
| 1177 |
can read VECTORS / ENZYMES / CLONING_METHODS / TAGS / LINKERS. -->
|
| 1178 |
<script src="/static/cloning_db.js?v=20260530-ui-polish" defer></script>
|
| 1179 |
-
<script src="/static/app.js?v=20260602-
|
| 1180 |
</body>
|
| 1181 |
</html>
|
|
|
|
| 22 |
<!-- ?v= query bumps invalidate browser + iframe asset caches when app.css /
|
| 23 |
app.js change. Bump these numbers whenever you ship a frontend update —
|
| 24 |
without them, users keep getting the stale file for up to a week. -->
|
| 25 |
+
<link rel="stylesheet" href="/static/app.css?v=20260602-noxscroll2" />
|
| 26 |
<link rel="icon" type="image/svg+xml" href="/static/favicon.svg?v=2" />
|
| 27 |
<link rel="apple-touch-icon" href="/static/favicon.svg?v=2" />
|
| 28 |
<!-- Mol* (PDBe) viewer for AlphaFold structure embed. Loaded async; the
|
|
|
|
| 1176 |
<!-- Cloning reference data must load before app.js so the Designer
|
| 1177 |
can read VECTORS / ENZYMES / CLONING_METHODS / TAGS / LINKERS. -->
|
| 1178 |
<script src="/static/cloning_db.js?v=20260530-ui-polish" defer></script>
|
| 1179 |
+
<script src="/static/app.js?v=20260602-noxscroll2" defer></script>
|
| 1180 |
</body>
|
| 1181 |
</html>
|