You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(ui): release only the scroll lock a dialog actually took
_setup() returns before locking when there is no content child, but _teardown()
unlocked unconditionally, so a contentless dialog could unlock without ever
locking. That consumed another open dialog's refcount and ran the full restore
mid-flight, dropping its compensation and jumping a fixed header until it
closed. Rounds 1 and 2 moved the lock's writes onto <html>, which widened what
this asymmetry could damage, so it is fixed here rather than left alone: each
element releases only what it took.
examples/blog kept its own copy of the lock, so example-blog.webjs.dev still had
the original #1144 shift while webjs.dev was fixed. The website's copy tracked
automatically because it is a gitignored mirror; the blog's is hand-maintained
and was missed. Its header opts in directly, since unlike the marketing site's
wrapper it paints its own chrome.
The global key follows the framework's existing prefix and carries a typed cast,
matching sonner.ts in the same directory instead of inventing a second
convention.
Docs now claim only what was measured. Firefox cannot be forced off overlay
scrollbars in headless Playwright here, so it was never measured with a
scrollbar that takes layout width, and asserting it honours the gutter was not
something this PR established. Nothing branches on the engine anyway.
Also drops an illustrative Tailwind class from a CSS comment: the scanner reads
inline styles, so it was emitting a real rule with an invalid value onto every
page.
Copy file name to clipboardExpand all lines: .agents/skills/webjs/references/styling.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -213,7 +213,7 @@ Anything that locks page scroll (a modal, a drawer, an off-canvas menu) hides th
213
213
214
214
`@webjsdev/ui`'s `<ui-dialog>` / `<ui-alert-dialog>` handle this for you (#1144). Their scroll lock reserves the scrollbar gutter for its duration, so the viewport width never changes and nothing moves. It leaves the gutter alone if your page already declared its own `scrollbar-gutter`, on the assumption that a page which made that choice meant it.
215
215
216
-
Two engines, two outcomes. Chromium and Firefox honour the reserved gutter, so nothing moves and the lock does nothing else. WebKit ignores `scrollbar-gutter`, so the viewport does widen there; the lock measures how much, pads `<html>` by it to hold in-flow content still (added to any padding you already had, and restored on close), and publishes the amount as `--wj-scrollbar-compensation` so a fixed element can opt in with one line:
216
+
Engines differ, and the lock does not need to know which one it is on. Where the gutter is honoured (measured on Chromium) nothing moves and the lock does nothing else. Where it is ignored (measured on WebKit) the viewport does widen, so the lock measures how much, pads `<html>` by it to hold in-flow content still (added to any padding you already had, and restored on close), and publishes the amount as `--wj-scrollbar-compensation` so a fixed element can opt in with one line:
0 commit comments