- The option
scrollbars.clickScroll
now supports the value'instant'
. TheClickScrollPlugin
is not required for it to work. #645
- Rewrite
clickScroll
animation for better performance and to support in and out easing for a smoother animation.
- Improve initialization and update performance by determining if a non-default scroll direction is possible before measuring scroll coordinates. #655
- Resilience against
scroll-behavior: smooth
style when scrolling should be instant.
- Reduced bundle size due to removed compatiblity code.
clickScroll
will not cancel on fast clicks / taps. #650- Add easing to the
clickScroll
animation. - The scrollbar-handle offset and size calculations are now entirely in CSS and will not force reflows.
- Use custom css properties for setting the scrollbar-handle offset and size.
- Only take the initial scroll coordinates from the
viewport
element if it has a scrollable overflow. (Otherwise take the initial scroll coordinates from the target element) #652
- The scrollbar handle size is now updated if the corresponding scrollbar element has an transition.
- Improvements to update performance.
- Added automated e2e performance metrics.
- Fix a bug where children attribute mutations were not picked up if the new attribute value was an empty string.
- Improve the
scrollCoordinates
logic introduced inv2.8.0
to have better defaults in cases of ambiguity. - The
scroll
event is not propagated if it is an result ofscrollCoordinates
detection during update. - Focus management improvements.
- Although not a major release, I've decided to remove the
rtlScrollBehavior
field from theEnvironment
object. The reason for it is a switch of how the library now detects scroll coordinates for non default flow directions. The replacement for this field is thescrollCoordinates
field of theState
object for each instance.
- Support non default flow directions (block and inline) not only
direction: rtl
. #625 - A new field
scrollCoordinates
in theState
object. It indicates the min. and max. scroll coordinates for the viewport. (useful for non default flow direction scrolling) - A new field
scrollCoordinatesChanged
in theupdateHints
object. It indicates whether the scroll coordinates changed in an update.
- Fix a Firefox only behavior where releasing a scrollbar handle over an anchor would trigger the anchor and navigate to it.
- Change
zoom
detection: instead of thewindow.resize
event, thewindow.matchMedia
event is used. - Greatly improve how dragging and releasing the scrollbar handle behaves for
scroll-snapped
viewports.
- Fix a bug here pointer capture was released too early for wacom pen devices. #630
- Use
{ preventScroll: true }
when focusing viewport to prevent unwanted scrolling. #629 - Make the scrollbars hidden when
@media print
applies. #628
- Handle case where
document.defaultView
isnull
. #627
- When interacting with a scrollbar the
viewport
element gets focused under certain conditions. (Like e.g. the previously focused element is not and interactive element.) - Move the environment styles from the stylesheet into javascript to remove the requirement of loaded styles for correct functionality.
- Improvements for running in
deno
andbun
. - Initialization as the
body
element is now detected as such when the tag name of the target element is"body"
. Previously this detection was done withtarget === target.ownerDocument.body
which would not work when creating a new body element in memory. - If a non generated
elements.viewport
element is provided during initialization its scroll position will be taken as the initial scroll position instead of the scroll position of thetarget
element. - When interacting with the scrollbars itself the
scrollbars.autoHideDelay
will now apply when the scrollbars would be auto hidden when the interaction ends.
- Fully remove lingering IE11 compatibility code which overwrote previously set
height
styles.
- Add
focusin
andfocusout
to the focus and blur event management when wrapping and unwrapping elements. #605 - The
scrollbars.visibility
option was unintuitive to use for adjusting visibility per axis. Its now only applied if the scrollbars scroll axis is able to have a scrollable overflow. #611
- Although not a major release, I've decided to drop
IE11
support in this version. This change should be beneficial to the majority of users.- The size of the js bundle decreased by
~6%
. - The size of the css bundle decreased by
~18%
. - The fields
flexboxGlue
andcssCustomProperties
are removed from theEnvironment
. (returning object fromOverlayScrollbars.env()
)
- The size of the js bundle decreased by
- Streamlining of scroll related calculations, including RTL direction.
- Focus and Blur event management when wrapping and unwrapping elements during initialization and destroy. #605
- Adapt the
exports
field in thepackage.json
for correctcommonjs
andmodule
handling. - Additional types exports:
Elements
,State
,CloneableScrollbarElements
,ScrollbarElements
,StaticInitialization
andDynamicInitialization
. - Remove obsolete styles when initializing
OverlayScrollbars
on thebody
element and the browser supports native scrollbar hiding. #601 - Move code to the
ScrollbarsHidingPlugin
for better treeshaking.
- If the pointer (mouse, pen etc.) is interacting with the scrollbar, the
autoHide
option will wait until the interaction is finished. #597 ScrollTimeline
animations are not canceled anymore when they are updated. Instead the animations keyframe effect is switched out preventing flickering. #598
- Its now possible to have a height / width transition on the scrollbar-handle. #587
- Fix a bug where ScrollTimeline animation keyframe could contain
NaN
orInfinity
values triggering a warning. #581 - Treat explicitly assigned
undefined
values for options as if they would be left out. #586
- Bug where the instance wasn't updated when the
window
resized. #578
- Further improvements to the update strategy to make finer grained updates.
- Makes custom instance plugins compatible with "pure" environments such as
react
and all other component frameworks / libraries.
- Add compatibility
exports
field topackage.json
so the'overlayscrollbars/styles/overlayscrollbars.css'
import works in all node versions. #570
- Finalize and document the plugin system which makes it possible to create "static" and / or "instance" plugins.
- The static
OverlayScrollbars.plugin
function returns a "static" plugins instance(s) for the registered plugins. - A new
instance.plugin
function which returns a "instance" plugins instance. - window
resize
events will now update instances only if it is needed and only what is needed.
- Small internal rewrite to improve stability, performance and bundle size.
- Improvements the documentation and README.
- The
element.animate
api is only called when the browser supports the ScrollTimeline API. #562
- Fix direction
rtl
visual scrollbar handle behavior in browser which support the ScrollTimeline API. - Fix double tap behavior for interactive elements on
iOS
devices ifautoHide
isleave
ormove
. #560 #285 - Fix incorrect scrollbar handle calculation when overscroll on safari occurred. #559
- Make use of the new ScrollTimeline API in supported browsers.
- Add the option
scrollbars.autoHideSuspend
to make it possible to suspend the autoHide functionality until the first scroll interaction was performed. The default value for this option isfalse
for backwards compatibility reasons but is recommended to betrue
for better accessibility. - Add a CSS selector to bridge deferred initializations visually.
- Fix a bug where a change wasn't detected properly when the target element was hidden initially. #546
- Fixed a bug where the scroll offset was reset to
0
sometimes after initialization when the target was thebody
element.
- Add online examples to README.
- Fix an issue where the
viewport
element could be wider than thehost
element. #538
- Instead of
offsetWidth
&offsetHeight
use the corresponding properties from thegetBoundingClientRect
object to increase accuracy of scrollbar calculations. #542
- Force the
scroll-behavior
css property to beauto
when the user interacts with a scrollbar to prevent smooth scrolling to apply where it shouldn't. #515 - The
viewort
,padding
andcontent
elements don't use theclass
attribute anymore for their styling. Instead each of them uses its owndata-overlayscrollbars-*
attribute. This has been done so that 3rd party libraries aren't conflicting with classnames from overlayscrollbars or vice versa. Selectors like.os-viewport
,.os-padding
or.os-content
won't work anymore. #526 #530
- Fixed a bug where pointer events weren't released properly after drag or click scrolling. #512
- The
os-theme-dark
andos-theme-light
themes now useborder-box
box-sizing as their default. - Improve the
README.md
documentation for initialization, styling and and the browser global version. #509
- Fix a bug where initial
RTL
direction wasn't detected properly.
- Introduce
CSS Custom Properties
to improve theming and styling of scrollbars. #478
- Improve pointer event handling on scrollbar handle and track.
- Improve the README documentation with a styling section.
- Revert the
viewport
andpadding
styleposition: relative
change introduced inv2.0.2
due to breaking behavior. #489 is considered a design limitation.
- The
viewport
andpadding
elements won't have the styleposition: relative
anymore if its not needed. The style is only needed for older browsers. (#489)
- The custom scrollbars are now always hidden if the
showNativeOverlaidScrollbars
option istrue
.
- The initialization to the
body
element respects nowoverflow: hidden
style overrides of thehtml
andbody
element. (#477) data-overlayscrollbars-initialize
is now automatically removed if the instance is destroyed or canceled.data-overlayscrollbars-initialize
now always setsoverflow: auto
to prevent elements to be suddenly cropped after initialization.- removed obsolete
!important
styles
OverlayScrollbars was rewritten from the ground up in TypeScript
in a functional manner.
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
plugins
which are treeshaken if unused - Multiple performance optimizations were made due to the new structure
- Framework Components benefit of the
pure
parameter foroptions
andevents
(same input produces same output) - TypeScript definitions are always up to date (
@types/overlayscrollbars
is obsolete now)
- If applied to
body
all 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
MutationObserver
for the content can be customized with theupdate
options. (#307, #183, #23) - Works now without adjustments with CSS-Grid, CSS-Flexbox etc.
- Supports all kind of input devices additionally to
mouse
andtouch
. (Uses native pointer-events now) - Exports a
esm
version which can be treeshaken
-
Browser support changed. The minimal version is now IE11.
-
There is no default export anymore. The main entry point is now the
OverlayScrollbars
named export. -
The
styles
are now exported under a different path. Read the docs for more info. -
The
scroll
function is missing. (WIP will be added as a plugin) -
Initialization to
textarea
element is not suppored. (WIP will be added as a plugin) -
extensions
are replaced withplugins
. Plugins are more powerful but work nothing likeextensions
. -
Any helper functions for
extensions
are removed. -
TypesScript
definitions changed completely. -
CSS
styles changed completely. -
There is no
jQuery
version anymore and nojQuery
compat 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
events
now instead ofeventsions
sinceextensions
are removed
-
The following options were removed / replaced / renamed:
resize
is removedsizeAutoCapable
is removed (works always now)clipAlways
is removed (works automatically now)normalizeRTL
is removed since thescroll
function isn't implemented yet there is nothing to normalizeautoUpdate
is removed since all browser support theMutationObserver
api there is no need for customizing a update loopautoUpdateInterval
is removedclassName
is replaced withscrollbars.theme
updateOnLoad
is replaced withupdate.elementEvents
nativeScrollbarsOverlaid.initialize
is replaced with theInitialization
concept. You can pass a object as target now where you can specify when to cancel the initialization of the plugin.nativeScrollbarsOverlaid.showNativeScrollbars
: is renamed toshowNativeOverlaidScrollbars
scrollbars.dragScrolling
is renamed toscrollbars.dragScroll
scrollbars.clickScrolling
is renamed toscrollbars.clickScroll
and animates the scroll change only with theClickScrollPlugin
otherwise its instantscrollbars.touchSupport
is replaced withscrollbars.pointers
scrollbars.snapHandle
is removedtextarea
is removed sincetextarea
initialization isn't possible yetcallbacks
is removed / replaced with theevents
concept. You can pass listeners / callback separately to the options. Thethis
context is nowundefined
as a replacement each event recieves theinstance
as its first argument.onScrollStart
is removedonScrollStop
is removedonInitialized
is replaced with theinitialized
eventonUpdated
is replaced with theupdated
theonDestroyed
is replaced with thedestroyed
eventonScroll
is replaced with thescroll
eventonInitializationWithdrawn
is replaced with thedestroyed
event (if the second argumentcanceled
istrue
)onOverflowChanged
is replaced with theupdated
event (its second argument holds the information whether the overflow changed)onOverflowAmountChanged
is replaced with theupdated
event (its second argument holds the information whether the overflow amount changed and how much)onDirectionChanged
is replaced with theupdated
event (its second argument holds the information whether the direction changed)onContentSizeChanged
is replaced with theupdated
event (its second argument holds the information whether the content got mutated)onHostSizeChanged
is replaced with theupdated
event (its second argument holds the information whether the host got mutated / its size changed)
-
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 anymoreext()
is removedaddExt()
is removedremoveExt()
is removedscroll()
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.
-
The following static methods were removed / replaced / renamed:
extension()
is removeddefaultOptions()
is replaced withenv().getDefaultOptions()
andenv().setDefaultOptions()
globals()
is replaced withenv()
-
If you used any fields from the
globals()
result, please refer to the TypeScript definitions for the correct replacement inenv()
- Because scrollbars can be cloned and positioned anywhere in the DOM, themes which worked in
v1
have to be adapted slightly:.os-scrollbar
elements now don't rely on its parent element. Selectors like.os-theme-dark > .os-scrollbar-vertical
are now.os-theme-dark.os-scrollbar-vertical
- the
.os-host-rtl
class is replaced with.os-scrollbar-rtl
. Selectors like.os-theme-dark.os-host-rtl > .os-scrollbar-horizontal
are now.os-theme-dark.os-scrollbar-rtl.os-scrollbar-horizontal