Skip to content

fix: show horizontal scrollbar on Uno without vertical overflow - #468

Closed
luckypong wants to merge 1 commit into
w-ahmad:mainfrom
luckypong:fix/uno-horizontal-scrollbar-indicator
Closed

luckypong wants to merge 1 commit into
w-ahmad:mainfrom
luckypong:fix/uno-horizontal-scrollbar-indicator

Conversation

@luckypong

@luckypong luckypong commented Oct 22, 2026 •

Copy link
Copy Markdown

Description

On Uno targets, the horizontal scrollbar never shows up when the rows fit vertically. In that case IndicatorMode on the horizontal scrollbar stays None and the thumb is invisible, so there's no way to scroll horizontally with a mouse on desktop WASM.

I dug into Uno's ScrollViewer, and it turns out it only hooks up its scroll indicator logic (PointerMoved → ScrollingIndicatorStates) for scrollbars it can find by name: HorizontalScrollBar / VerticalScrollBar (or the PART_ variants). Our template names the horizontal one HorizontalScrollBar2, so Uno never picks it up. As long as there's a vertical scrollbar, the visual state still gets driven through that one and everything looks fine. Without vertical overflow, though, nothing ever moves the state out of NoIndicator.

This also explains why the workaround I posted in the issue (temporarily forcing VerticalScrollBarVisibility = Visible) only worked sometimes. It relied on the vertical scrollbar being materialized at exactly the right moment.

The fix sets IndicatorMode = MouseIndicator on HorizontalScrollBar2 in OnScrollViewerLoaded, for non-Windows targets only. When a vertical scrollbar is present, Uno's visual states still animate the value as before, so that case behaves the same as today.

I didn't rename the scrollbar back to HorizontalScrollBar. That would let Uno's ScrollViewer scroll the content horizontally on its own, which would conflict with how TableView handles HorizontalOffset and the frozen row header.

I am not sure if this issue occurred only in my development environment, but I confirmed that it works correctly in the modified code.

Related Issue

Closes #421

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 📝 Documentation update
  • ♻️ Refactor
  • 🧪 Test
  • 🔧 Chore / maintenance

Checklist

  • This PR is not from my main branch
  • Tested with WinUI target
  • Tested with Uno Platform target
  • Unit / integration tests added or updated
  • Documentation updated to reflect changes
  • Code follows the project's coding conventions

Screenshots / Recordings

Additional Notes

  • Repro: In the sample app's Pagination page, set PageSize = 3 and narrow the window below the total column width. Previously, no horizontal scrollbar appeared and dragging the bottom edge did nothing. Now, the indicator shows up right away, expands on hover, and lets you drag all the way to the last column. Tested on WASM (Uno 6.5 & 6.7).
  • The change is wrapped in #if !WINDOWS, so the WinUI target isn't affected. I only verified that it builds there; I haven't run it.
  • In the absence of a vertical scrollbar, the horizontal indicator remains visible as a thin line rather than auto-hiding. Replicating Uno's hide timer seemed overly complex for this use case.
  • The "scrolling only works in empty areas" part of Uno WASM: Horizontal scrollbar is not displayed when there is no vertical overflow #421 is a separate problem and isn't addressed here.

@luckypong luckypong closed this Oct 29, 2026
@luckypong
luckypong deleted the fix/uno-horizontal-scrollbar-indicator branch October 29, 2026 08:17
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.

Uno WASM: Horizontal scrollbar is not displayed when there is no vertical overflow

1 participant