fix(mobile): the drawer no longer pushes the page sideways
Release / Build and publish image (push) Failing after 10m8s
Release / Build and publish image (push) Failing after 10m8s
The task drawer was `width: 100vw`. A viewport unit includes the scrollbar gutter and a percentage does not, so the drawer came out a few pixels wider than the page it was pinned to and the whole document could be shoved sideways. It is `100%` now, and at phone width it is stated as four insets instead — a box defined by the viewport's own edges cannot be a rounding error wider than it. The scrolling body gets `min-width: 0` and `overflow-x: hidden` too, so a pasted URL or a long unbroken word in a comment cannot stretch the flex column and take the page with it. Writing the test for that found another one: creating a project from the sidebar navigated to it and left the drawer covering the screen. Every link in there closes it on the way out; the form did not, because it calls `goto` directly. Now it does the same thing for the same reason. The phone test checks the document cannot be scrolled horizontally, both with the drawer shut and with it open. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
6d27d730d2
commit
494640c1a8
@@ -575,7 +575,12 @@
|
||||
.drawer {
|
||||
position: fixed;
|
||||
inset: 0 0 0 auto;
|
||||
width: min(480px, 100vw);
|
||||
/* `100%` rather than `100vw`. For a fixed element a percentage resolves
|
||||
against the initial containing block, which excludes the scrollbar gutter
|
||||
— `100vw` does not, so the drawer was a few pixels wider than the page and
|
||||
the whole document could be pushed sideways. */
|
||||
width: min(480px, 100%);
|
||||
max-width: 100%;
|
||||
z-index: 80;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -625,7 +630,12 @@
|
||||
|
||||
.scroll {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
overflow-y: auto;
|
||||
/* Nothing inside may widen the drawer. A pasted URL in a comment or a long
|
||||
unbroken word would otherwise stretch the flex column and take the page
|
||||
with it. */
|
||||
overflow-x: hidden;
|
||||
overscroll-behavior: contain;
|
||||
padding: var(--s4) var(--s4) var(--s8);
|
||||
display: flex;
|
||||
@@ -883,8 +893,12 @@
|
||||
}
|
||||
|
||||
@media (max-width: 560px) {
|
||||
/* Full width, stated as four insets rather than a width: the box is then
|
||||
defined by the viewport's edges and cannot be a rounding error wider than
|
||||
the thing it is pinned to. */
|
||||
.drawer {
|
||||
width: 100vw;
|
||||
inset: 0;
|
||||
width: auto;
|
||||
border-left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user