Skip to content

feat: allow users to force hide scrollbars#755

Open
lofcz wants to merge 1 commit intoKingSora:masterfrom
lofcz:feat-enable-force-hiding-scrollbars
Open

feat: allow users to force hide scrollbars#755
lofcz wants to merge 1 commit intoKingSora:masterfrom
lofcz:feat-enable-force-hiding-scrollbars

Conversation

@lofcz
Copy link

@lofcz lofcz commented Mar 20, 2026

Thanks for OverlayScrollbars, long time user here.. (I know OSS maintainers hear this a lot first hand, but still).

Problem

In a split layout, I animate the chat column with transforms, then switch to flex. On desktop, with scrollbars.autoHide: "move", the pointer often crosses the moving host during the animation. That drives the normal pointer/scroll auto-hide logic. When the animation ends and layout updates, the scrollbar can flash visible for a moment even if the cursor is no longer over the pane, it’s especially noticeable with the default opacity transition on .os-scrollbar.

2026-03-20.11-09-35.mp4

Proposed Solution

Add an imperative instance method so embedders can temporarily force-hide scrollbars and ignore the usual auto-show sensor paths until they call the method again to restore normal behavior:

export interface OverlayScrollbars {
+  scrollbarsHidden(hidden: boolean): void;
}

When hidden === true, the instance should keep overlay scrollbars in the hidden state across internal update() cycles (e.g. after resize) so layout changes don’t briefly apply os-scrollbar-visible without the matching auto-hide hidden state.

@lofcz lofcz force-pushed the feat-enable-force-hiding-scrollbars branch from df3c944 to 917e07e Compare March 20, 2026 10:31
@lofcz lofcz force-pushed the feat-enable-force-hiding-scrollbars branch from 917e07e to 808138c Compare March 20, 2026 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant