Replies: 6 comments 12 replies
-
FYI @idiotWu https://greensock.com/scrollsmoother/
|
Beta Was this translation helpful? Give feedback.
-
Yeah, I've always been thinking about the same thing. However, it will become completely another plugin if we use the native scrollbars, and will be a bit difficult to customize the appearance. Also, as the native scrollbars do not come with smooth scrolling, we still need to interpolate P.S. although we can use |
Beta Was this translation helpful? Give feedback.
-
Thanks for your response! However, |
Beta Was this translation helpful? Give feedback.
-
@ehsan-shv what about adding a |
Beta Was this translation helpful? Give feedback.
-
Another idea is to add an abstraction layer that provides a general API set for both native scrollbars and smooth-scrollbar, just like those graphics libraries. For example, it can be implemented as: class ScrollbarAdapter {
constructor(useNative: boolean) {};
update(): void;
getSize(): ScrollbarSize;
isVisible(elem: HTMLElement): boolean;
addListener(fn: ScrollListener): void;
removeListener(fn: ScrollListener): void;
scrollTo(x?: number, y?: number, duration?: number, options?: Partial<ScrollToOptions>): void;
setPosition(x?: number, y?: number, options?: Partial<SetPositionOptions>): void;
scrollIntoView(elem: HTMLElement, options?: Partial<ScrollIntoViewOptions>): void;
} In this way, however, we are not able to use the plugin system anymore as it's not available in native scrollbars 😞. |
Beta Was this translation helpful? Give feedback.
-
@idiotWu Hey! I've published react-nice-scroll based on smooth-scrollbar. Would you please check the code and if there is an issue or if you have an idea tell me. |
Beta Was this translation helpful? Give feedback.
-
Motivation
smooth-scroll library is an amazing library for developing creative web apps but because this library uses a virtual scroll to translate content this makes some performance issues, especially on touch devices.
Proposal
Recently GSAP introduced a plugin named "smoothscroll". In this plugin, they use native scroll for smooth scrolling. Is this possible to refactor this library to use native scroll?
Beta Was this translation helpful? Give feedback.
All reactions