mirror of
https://github.com/tenrok/OverlayScrollbars.git
synced 2026-06-21 14:20:37 +03:00
4.6 KiB
4.6 KiB
Changelog
2.0.0
OverlayScrollbars was rewritten from the ground up in TypeScript.
The rewrite comes with multiple benefits:
- The library is much smaller now (about 50% smaller fully treeshaken)
- Modern browsers benefit greatly because compat code is inside
pluginswhich are treeshaken if unused - Multiple performance optimizations were made due to the new structure
- Framework Components benefit of the
pureparameter foroptionsandevents(same input produces same output) - TypeScript definitions are always up to date (
@types/overlayscrollbarsis obsolete now)
New Features:
- If applied to
bodyall the native functionality in modern browsers (e.g. swipe down to refresh on mobile, scroll restoration etc.) is preserved (#376, #425, #273, #320) - If you scroll while the cursor hovers a scrollbar element the viewport is now scrolled (#128, #322)
- The initialization process can be fully customized now. This makes it possible to itegrate with other plugins / libraries (#432, #304, #149, #148, #139, #49)
- Scrollbars can be cloned and positioned anywhere in the DOM tree. (#404, #323, #158, #17)
- The update behavior of the
MutationObserverfor the content can be customized with theupdateoptions. (#307, #183, #23) - It works now without adjustments with CSS-Grid, CSS-Flexbox etc.
Breaking changes:
- Browser support changed. The minimal version is now IE11.
- The
scrollfunction is missing. (WIP will be added as a plugin) - Initialization to
textareaelement is not suppored. (WIP will be added as a plugin) - Because scrollbars can be cloned and positioned anywhere in the DOM, themes which worked in
v1have to be adapted slightly. extensionsare replaced withplugins. Plugins are more powerful but work nothing likeextensions.- Any helper functions for
extensionsare removed. TypesScriptdefinitions changed completely.- There is no
jQueryversion anymore and nojQuerycompat functionality - The following changed for the
initialization:- Arrays of elements are not supported anymore. If you want to initialize the plugin to multiple elements, you have to loop over them.
- Since the initialization is now fully customizable, the plugin won't have special behavior anymore if it has children with
os-classnames - The third parameter are
eventsnow instead ofeventsionssinceextensionsare removed
- The following options were removed / replaced / renamed:
classNameis replaced withscrollbars.themeresizeis removedsizeAutoCapableis removed (works always now)clipAlwaysis removed (works automatically now)normalizeRTLis removed since thescrollfunction isn't implemented yet there is nothing to normalizeautoUpdateis removed since all browser support theMutationObserverapi there is no need for customizing a update loopautoUpdateIntervalis removedupdateOnLoadis replaced withupdate.elementEventsnativeScrollbarsOverlaid.showNativeScrollbars: is renamed toshowNativeOverlaidScrollbarsnativeScrollbarsOverlaid.initializeis replaced with theInitializationconcept. You can pass a object as target now where you can specify when to cancel the initialization of the plugin.scrollbars.dragScrollingis renamed toscrollbars.dragScrollscrollbars.clickScrollingis renamed toscrollbars.clickScrolland animates the scroll change only with theClickScrollPluginotherwise its instantscrollbars.touchSupportis replaced withscrollbars.pointersscrollbars.snapHandleis removedtextareais removed sincetextareainitialization isn't possible yetcallbacksis removed / replaced with theeventsconcept. You can pass listeners / callback separately to the options.
- The following instance methods were removed / replaced / renamed:
sleep()is removed since it doesn't fit into the new structure and shouldn't be needed anymorescroll()is removed (WIP)scrollStop()is removed (WIP)getElements()is renamed toelements()and doesn't support any argumens anymore.getState()is renamed tostate()and doesn't support any argumens anymore.ext()is removedaddExt()is removedremoveExt()is removed
- The following static methods were removed / replaced / renamed:
defaultOptions()is replaced withenv().getDefaultOptions()andenv().setDefaultOptions()globals()is replaced withenv()extension()is removed
- If you used any fields from the
globals()result, please refer to the TypeScript definitions for the correct replacement inenv()