Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom ScrollView component #20

Open
Tropix126 opened this issue Jan 24, 2022 · 2 comments
Open

Custom ScrollView component #20

Tropix126 opened this issue Jan 24, 2022 · 2 comments

Comments

@Tropix126
Copy link
Owner

Tropix126 commented Jan 24, 2022

Cross-browser scrollbar theming is enraging

  • Webkit has pretty decent theming support, but ::-webkit-scrollbar also has a lot of limitations.
  • Firefox has less to none customization, and pretty much only allows you to hide the scrollbar or change basic colors around.

To get around this, I want to design a custom ScrollView component, that still uses native scrolling but adds our own DOM-based scrollbar component to accurately replicate WinUI's ScrollViewer.

Considerations:

  • Accessibility (of course)
  • Progressive Enhancement - I want the native scrollbars to be visible when JS is disabled or before hydration.
  • Performance - scroll events are weird sometimes
  • Keyboard Navigation
  • Component-level scrolling customizations (binding to scrollX/scrollY, etc...)

A good starting place would probably be looking at how https://www.radix-ui.com/docs/primitives/components/scroll-area does it.

@Tropix126 Tropix126 changed the title ScrollView` Custom ScrollView component Jan 24, 2022
@paperdave
Copy link

something I would like if this were to be added would be the ability to use the scrollbar itself as a component (give it a height + offset) where it doesn't have a scrollable content area. Is this something you'd consider, even as just an internal component to be used to make a more general ScrollView / Scroll Area component? (wait, is that what the last consideration means)

@Tropix126
Copy link
Owner Author

something I would like if this were to be added would be the ability to use the scrollbar itself as a component (give it a height + offset) where it doesn't have a scrollable content area. Is this something you'd consider, even as just an internal component to be used to make a more general ScrollView / Scroll Area component? (wait, is that what the last consideration means)

ScrollBar would be an internal component I could export, yeah.

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

No branches or pull requests

2 participants