Commit 6ea5b45
committed
Fix mobile scroll lock after backgrounding; smooth the top-bar hide/reveal (#977)
* Fix mobile scroll lock after app backgrounding: viewport lock + resume unstick
iOS can restore the app (PWA or Safari) with the window scrolled off
origin; the body then swallows touch gestures and .main-content can't
scroll until a tap breaks it loose.
Restore the html/body viewport lock removed in 1b4aae5 - it was
dropped to preserve native pull-to-refresh, which was replaced by
custom PTR the same day, so nothing needs body scroll anymore. Scoped
via :has(.app-container) so the login page still scrolls. Also snap
the window back to origin on pageshow/visibilitychange as a second
layer for cases the CSS lock can't cover.
* Drop position:fixed from viewport lock; overflow:hidden is enough
position:fixed on body disturbed the dynamic-viewport behavior the
sticky top-bar hide animation rides on, making the nav-bar hide feel
off on scroll down. overflow:hidden alone still blocks body scroll,
and the pageshow/visibilitychange handler remains the primary backstop
for the background-resume case.
* Smooth the mobile top-bar hide: translateY instead of top:-100%
The hide animated 'top' toward -100%, which resolves against the tall
scroll container (~800px), so the ~65px bar cleared the screen in the
first few ms of the 0.35s transition - an abrupt snap. Slide by
transform: translateY(-100%) (100% = the bar's own height) over 0.4s so
the full duration moves exactly one bar-height: a gradual slide.
* Slow the top-bar reveal to 0.6s, keep the hide at 0.4s
Split the transition timing: the base .top-bar rule governs the reveal
(slower, 0.6s) and .top-bar-hidden governs the hide (0.4s).1 parent 7491869 commit 6ea5b45
2 files changed
Lines changed: 30 additions & 2 deletions
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
235 | 245 | | |
236 | 246 | | |
237 | 247 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3176 | 3176 | | |
3177 | 3177 | | |
3178 | 3178 | | |
| 3179 | + | |
| 3180 | + | |
| 3181 | + | |
| 3182 | + | |
| 3183 | + | |
| 3184 | + | |
| 3185 | + | |
| 3186 | + | |
| 3187 | + | |
| 3188 | + | |
3179 | 3189 | | |
3180 | 3190 | | |
3181 | 3191 | | |
| |||
3261 | 3271 | | |
3262 | 3272 | | |
3263 | 3273 | | |
3264 | | - | |
| 3274 | + | |
| 3275 | + | |
3265 | 3276 | | |
3266 | 3277 | | |
| 3278 | + | |
| 3279 | + | |
| 3280 | + | |
| 3281 | + | |
| 3282 | + | |
3267 | 3283 | | |
3268 | 3284 | | |
3269 | | - | |
| 3285 | + | |
| 3286 | + | |
| 3287 | + | |
3270 | 3288 | | |
3271 | 3289 | | |
3272 | 3290 | | |
| |||
0 commit comments