This article is about fixing Scrolling under fixed element in KingSora OverlayScrollbars
  • 01-Feb-2023
Lightrun Team
Author Lightrun Team
Share
This article is about fixing Scrolling under fixed element in KingSora OverlayScrollbars

Scrolling under fixed element in KingSora OverlayScrollbars

Lightrun Team
Lightrun Team
01-Feb-2023

Explanation of the problem

 

The Overlay Scrollbar is not registering the scroll event when it is overlapped by a fixed element.

Steps to Reproduce: To reproduce the behavior, follow these steps:

- Visit the following fiddle: [Insert Fiddle Link Here]
- Inspect the fiddle with the javascript line commented out
- Try scrolling over the red box, the scrolling should occur
- Uncomment the javascript code in the fiddle to initialize the OverlayScrollbars
- Try scrolling over the red box, you should not be able to

The expected behavior is for OverlayScrollbars to mimic the way the browser natively implements this type of scenario. In other words, it should allow the scrolling underneath the fixed element.

Used Browsers (with version): Tested on Firefox 78.0.2 and Chrome 84.0.4147.89

Troubleshooting with the Lightrun Developer Observability Platform

Getting a sense of what’s actually happening inside a live application is a frustrating experience, one that relies mostly on querying and observing whatever logs were written during development.
Lightrun is a Developer Observability Platform, allowing developers to add telemetry to live applications in real-time, on-demand, and right from the IDE.

  • Instantly add logs to, set metrics in, and take snapshots of live applications
  • Insights delivered straight to your IDE or CLI
  • Works where you do: dev, QA, staging, CI/CD, and production

Start for free today

Problem solution for Scrolling under fixed element in KingSora OverlayScrollbars

The Overlay Scrollbar is a component that allows users to scroll through content that is displayed on a page. The issue at hand is that when the Overlay Scrollbar is overlapped by a fixed element, it is not registering the scroll event and does not allow for scrolling. This behavior is unexpected and reduces the usability of the component for users.

The proposed solution to address this issue is the release of version 2 of the software. The release aims to bring improvements to the Overlay Scrollbar component and provide a better user experience for those affected by the issue. The new version of the software is expected to allow for the correct registration of the scroll event even when the Overlay Scrollbar is overlapped by a fixed element.

The implementation details of the solution are not disclosed, but it is likely that the issue with the Overlay Scrollbar component has been identified and fixed through the development and testing process. The new version of the software may incorporate changes to the code or design of the component to ensure that the issue with the scroll event registration is resolved. This will ensure that users can scroll through content on a page as expected, even when the Overlay Scrollbar is overlapped by a fixed element.

Example code showing the implementation of the Overlay Scrollbar component:

<div id="scrollbar-container">
  <div id="content">
    <!-- Content to be scrolled goes here -->
  </div>
</div>

<script>
var scrollbar = OverlayScrollbars(document.getElementById("scrollbar-container"), {
  // options go here
});
</script>

A brief introduction to OverlayScrollbars

KingSora OverlayScrollbars is a JavaScript library for creating custom scrollbars in web pages. It provides a flexible and lightweight solution for customizing the appearance and behavior of scrollbars in a web page. KingSora OverlayScrollbars is designed to work with modern web browsers and offers support for touch devices, ensuring that the scrollbars are smooth and responsive across a wide range of devices.

Key Features of KingSora OverlayScrollbars KingSora OverlayScrollbars offers a wide range of customization options to allow developers to create scrollbars that match the look and feel of their website. The library provides options for customizing the appearance of the scrollbars, including the color, size, and thickness. Additionally, KingSora OverlayScrollbars allows developers to customize the behavior of the scrollbars, including options for auto-hide, snap-back, and touch support. These features help to improve the user experience by providing a more intuitive and customizable scrolling behavior. The library is lightweight and fast, making it suitable for use on high-traffic websites where page performance is a critical factor.

Most popular use cases for OverlayScrollbars

  1. Customizing the appearance of scrollbars: KingSora OverlayScrollbars provides options to customize the appearance of the scrollbars in a web page. The appearance of the scrollbars can be changed to match the overall look and feel of the website. This helps to enhance the user experience and create a more cohesive design.
  2. Improving page performance: KingSora OverlayScrollbars can improve page performance by using hardware acceleration to render the scrollbars. This helps to ensure that the scrollbars are smooth and responsive, even on lower-end devices.
  3. Customizing scrollbar behavior: KingSora OverlayScrollbars allows for customization of the behavior of the scrollbars, including options for auto-hide, snap-back, and touch support. This can improve the user experience by providing more intuitive and customizable scrolling behavior.
Share

It’s Really not that Complicated.

You can actually understand what’s going on inside your live applications.

Try Lightrun’s Playground

Lets Talk!

Looking for more information about Lightrun and debugging?
We’d love to hear from you!
Drop us a line and we’ll get back to you shortly.

By submitting this form, I agree to Lightrun’s Privacy Policy and Terms of Use.