Files
outline/app/hooks
Tom MoorandClaude Fable 5 9af5e56523 fix: useWindowScrollbarWidth measured horizontal overflow, not scrollbar width (#13030)
* fix: useWindowScrollbarWidth measured horizontal overflow, not scrollbar width

document.documentElement.scrollWidth - clientWidth measures horizontal
content overflow, which is 0 in the normal case even when a vertical
scrollbar is visible — so the hook always reported 0 on platforms with
classic (non-overlay) scrollbars, and the right sidebar's fixed-position
content in Aside was never narrowed to account for the scrollbar.

Measure window.innerWidth - documentElement.clientWidth instead, which
is the layout viewport width including the scrollbar minus the width
excluding it. Verified in headless Chromium: with a forced vertical
scrollbar the old expression returns 0 while the new one returns the
true scrollbar width (15px).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DjhYP8svLL8dU98tmQJ7RK

* chore: Remove explanatory comment

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DjhYP8svLL8dU98tmQJ7RK

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-07-18 09:35:55 -04:00
..
2025-05-03 19:40:18 -04:00