Code Monkey home page Code Monkey logo

Comments (3)

KingSora avatar KingSora commented on June 11, 2024

Good day @joshkalsi :)

The behavior in your example is normal browser behavior and is not related to the plugin... If you switch out the OverlayScrollbarsComponent with a simple div which has overflow: auto as style you'll get the same behavior. (https://codesandbox.io/p/sandbox/overlayscrollbars-fixed-element-bug-forked-glhnx9?file=%2Fsrc%2FApp.js%3A14%2C13)

The difference between your example and #249 is that in the other issue the fixed element is not wrapped in a different overflowing container but its nearest overflowing container is the body element / the window scroller element.

If I change your example to the equivalent the native behavior is what you would expect. (https://codesandbox.io/p/sandbox/overlayscrollbars-fixed-element-bug-forked-27nc8l?file=%2Fsrc%2FApp.js%3A11%2C13)
If I then apply OverlayScrollbars to the body element it has the behavior you want and what was fixed in #249 (https://codesandbox.io/p/sandbox/overlayscrollbars-fixed-element-bug-forked-rpqy54?file=%2Fsrc%2FApp.js%3A13%2C11)

In this case its really important which element is the overflowing container (some div or the body element) for the fixed element.

from overlayscrollbars.

joshkalsi avatar joshkalsi commented on June 11, 2024

That's sorted the issue, thank you, didn't even think to check if it would have the same issue with native scroll! Appreciate the quick response, thanks again 👍

from overlayscrollbars.

KingSora avatar KingSora commented on June 11, 2024

@joshkalsi Youre welcome :)

from overlayscrollbars.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.