KingSora / OverlayScrollbars

A javascript scrollbar plugin that hides the native scrollbars, provides custom styleable overlay scrollbars, and preserves the native functionality and feel.
https://kingsora.github.io/OverlayScrollbars
MIT License
3.84k stars 214 forks source link

OeverlayScrollbar dynamically changed transfrom is not visible in DOM element #563

Closed mukhammad-akilov closed 1 year ago

mukhammad-akilov commented 1 year ago

Describe the bug OeverlayScrollbar dynamicallychanged transfrom is not visible in DOM changes. For exmaple if I make scroll or auto scroll then div.os-scrollbar-handle shuould take styles with transform but I can't see these styles in Google Chrome image

A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://kingsora.github.io/OverlayScrollbars/example/overlayscrollbars/ with Chrome browser (or based or browser based on Chrome engine)
  2. Open DevTools
  3. Scroll down little beet
  4. Investiage div.os-scrollbar-handle DOM element and see error

Expected behavior In Firefox browser transform property is visible: image

Examples For exmaple you can use this default demo: https://kingsora.github.io/OverlayScrollbars/example/overlayscrollbars/

Environment

The reason I need this property beacuse I created two custom scrollbars and the first one is scrolled automatically that is why I am observing the changes from another scroll container using MutationObserver API and apply transform style to the first one.

KingSora commented 1 year ago

Good day @mukhammad-akilov :)

This change was introduced in version 2.3.0. Supported browsers (such as chrome) use the scrolltimeline api to move the scrollbar handles. Eventually this will be the way how the scrollbar handles will move in every browser because it improves the performance signifficantly.

Since the value you need is calculated from other values you shouldn't need a MutationObserver at all. Can you post an example of what you exactly wanna create? I would look into it and make an version which works without the MutationObserver.