Invisible Scrollbar / Scrollbar visibility? #9548

Open
opened 2026-09-18 14:54:21 +00:00 by glaytondf · 3 comments
glaytondf commented 2026-09-18 14:54:21 +00:00 (Migrated from github.com)

Version/Branch of Dear ImGui:

Version 1.92.2, Branch: docking

Back-ends:

imgui_impl_win32.cpp + imgui_impl_dx11.cpp

Compiler, OS:

Windows11 MSVC 2022

Full config/build information:

Is it possible to replicate the scrolling behavior shown in the attached video?
Specifically, where the scrollbar only appears when the mouse hovers over its area, and it does not occupy its own dedicated space but instead overlays the content of the last column.

https://github.com/user-attachments/assets/82f6c1f6-b687-4e89-a9de-04844bb8fb21

Details:

My Issue/Question:

XXX (please provide as much context as possible)

Screenshots/Video:

No response

Minimal, Complete and Verifiable Example code:

// Here's some code anyone can copy and paste to reproduce your issue
ImGui::Begin("Example Bug");
MoreCodeToExplainMyIssue();
ImGui::End();
### Version/Branch of Dear ImGui: Version 1.92.2, Branch: docking ### Back-ends: imgui_impl_win32.cpp + imgui_impl_dx11.cpp ### Compiler, OS: Windows11 MSVC 2022 ### Full config/build information: Is it possible to replicate the scrolling behavior shown in the attached video? Specifically, where the scrollbar only appears when the mouse hovers over its area, and it does not occupy its own dedicated space but instead overlays the content of the last column. https://github.com/user-attachments/assets/82f6c1f6-b687-4e89-a9de-04844bb8fb21 ### Details: **My Issue/Question:** XXX _(please provide as much context as possible)_ ### Screenshots/Video: _No response_ ### Minimal, Complete and Verifiable Example code: ```cpp // Here's some code anyone can copy and paste to reproduce your issue ImGui::Begin("Example Bug"); MoreCodeToExplainMyIssue(); ImGui::End(); ```
ocornut commented 2026-09-18 15:08:13 +00:00 (Migrated from github.com)

No, this is not supported.

My issue with implementing it is the following:

It does indeed prevent a whole category of problems (feedback loop between contents sizes and scrollbar visibility, e.g. #8488, #3285).
If it is exposed as a Style option, it raises the issue that we'd have a Style option can hide a whole category of problems, and then code written somewhere might break elsewhere if the style is different because it wasn't checked for feedback loop issues. That doesn't seem desirable for a healthy code sharing ecosystem.

So my gut feeling is that the only possible move would be to enforce a scheme everywhere where scrollbar visibility does not alter layout, which could be a choice between invisible and appearing over contents (as in your video), invisible and appearing next to contents (would work if thin enough). That's not a change I would make casually. Especially considering that technical profile/users tend to dislike non-visible scrollbars.

No, this is not supported. My issue with implementing it is the following: It does indeed prevent a whole category of problems (feedback loop between contents sizes and scrollbar visibility, e.g. #8488, #3285). If it is exposed as a Style option, it raises the issue that we'd have a Style option can hide a whole category of problems, and then code written somewhere might break elsewhere if the style is different because it wasn't checked for feedback loop issues. That doesn't seem desirable for a healthy code sharing ecosystem. So my gut feeling is that the only possible move would be to enforce a scheme everywhere where scrollbar visibility does not alter layout, which could be a choice between invisible and appearing over contents (as in your video), invisible and appearing next to contents (would work if thin enough). That's not a change I would make casually. Especially considering that technical profile/users tend to dislike non-visible scrollbars.
ocornut commented 2026-09-18 15:08:13 +00:00 (Migrated from github.com)

No, this is not supported.

My issue with implementing it is the following:

It does indeed prevent a whole category of problems (feedback loop between contents sizes and scrollbar visibility, e.g. #8488, #3285).
If it is exposed as a Style option, it raises the issue that we'd have a Style option can hide a whole category of problems, and then code written somewhere might break elsewhere if the style is different because it wasn't checked for feedback loop issues. That doesn't seem desirable for a healthy code sharing ecosystem.

So my gut feeling is that the only possible move would be to enforce a scheme everywhere where scrollbar visibility does not alter layout, which could be a choice between invisible and appearing over contents (as in your video), invisible and appearing next to contents (would work if thin enough). That's not a change I would make casually. Especially considering that technical profile/users tend to dislike non-visible scrollbars.

No, this is not supported. My issue with implementing it is the following: It does indeed prevent a whole category of problems (feedback loop between contents sizes and scrollbar visibility, e.g. #8488, #3285). If it is exposed as a Style option, it raises the issue that we'd have a Style option can hide a whole category of problems, and then code written somewhere might break elsewhere if the style is different because it wasn't checked for feedback loop issues. That doesn't seem desirable for a healthy code sharing ecosystem. So my gut feeling is that the only possible move would be to enforce a scheme everywhere where scrollbar visibility does not alter layout, which could be a choice between invisible and appearing over contents (as in your video), invisible and appearing next to contents (would work if thin enough). That's not a change I would make casually. Especially considering that technical profile/users tend to dislike non-visible scrollbars.
tope99 commented 2026-09-20 16:38:53 +00:00 (Migrated from github.com)

There is a way how to achieve something similar. Set scrollbar size to zero: ImGui::PushStyleVar(ImGuiStyleVar_ScrollbarSize, 0). Then upon mouse dragging reset window->ScrollbarSize and draw it again using ImGui::Scrollbar. ImRAD generates the required code when scrollWhenDragging table property is set.

There is a way how to achieve something similar. Set scrollbar size to zero: `ImGui::PushStyleVar(ImGuiStyleVar_ScrollbarSize, 0)`. Then upon mouse dragging reset `window->ScrollbarSize` and draw it again using `ImGui::Scrollbar`. ImRAD generates the required code when `scrollWhenDragging` table property is set.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ocornut/imgui#9548
No description provided.