VOOZH about

URL: https://blog.logrocket.com/what-chromiums-browser-compatibility-means-for-scrolling/

⇱ What Chromium’s browser compatibility means for scrolling - LogRocket Blog


2020-11-20
713
#chrome
Solomon Eseme
29288
👁 Image

See how LogRocket's Galileo AI surfaces the most severe issues for you

No signup required

Check it out

🚀 Sign up for The Replay newsletter

The Replay is a weekly newsletter for dev and engineering leaders.

Delivered once a week, it's your curated guide to the most important conversations around frontend dev, emerging AI tools, and the state of modern software.

Introduction

In 2019, MDN surveyed thousands of developers around the world to gain insight on what’s presently frustrating — and what’s not — about the web.

👁 Google Chromium Icon

From the survey, the top frustration for web developers was browser compatibility.

Browser compatibility has always been an issue with web developers and designers who are trying to build a web application that’s compatible with different browsers, especially Internet Explorer 11 (IE11).

In this article, we’ll discuss how Google Chrome intends to solve this problem by focusing on browser compatibility and what it means for scrolling.

What is browser compatibility?

Browser compatibility refers to the ability for a particular web application to appear fully functional on different browsers.

Assuming you’re developing a web application that you want to be compatible with multiple browsers, you have to code the HTML, CSS, and JavaScript to do so, or create different versions of a website based on the platform your users are accessing your website from. This has been a continuous issue in the developers’ ecosystem.

According to the MDN survey, the Chromium team has been trying to resolve some of these compatibility issues on Google Chrome. Here are just a few ways they are trying to improve compatibility.

Flexbox

When it comes to structuring your web application, Flexbox is a powerful tool for laying out the structure of your web application. It is one of the top tools for browser compatibility.

As powerful as Flexbox is, there are some new improvements that will be introduced in Chrome 84 that will help solve compatibility issues. The Chrome team is looking at re-architecting the Chromium Flexbox implementation with the modern LayoutNG engine. To get started with Flexbox, you can check out the beginner’s guide here.

CSS Grid

CSS Grid is another great tool for browser compatibility, and, according to the Google Chrome team, CSS Grid is supported in Chromium browsers. It’s also great to note that even though Chromium still doesn’t support Subgrid at the time of writing, it is currently in development and may be added as part of the new LayoutNG engine. For more information about CSS Grid, read this informative article.

Scrolling

In the survey responses, many types of scrolling-related issues came up, such as:

  • The effect of shrinking/hiding URL bar when scrolling on mobile devices, based on the viewport size
  • Difficulties controlling native scroll, so developers end up using JavaScript instead. This includes overscroll behavior and scroll snapping
  • Differences in behavior or support for scrolling-related APIs like scrollIntoView

Luckily, you can solve these issues using CSS Scroll Snapping. Let’s demonstrate how to it.

CSS Scroll Snapping allows you to lock the viewport of certain elements after a user has finished scrolling. You can use it to build a great interaction like this.

CSS Scroll Snapping was introduced in 2016 and has improved significantly over the past few years, and it supports a majority of browsers and their latest versions.

To begin, create an HTML file.

<div class="container">
 <section class="child"></section>
 <section class="child"></section>
 <section class="child"></section>
 <p>...</p>
</div>

Now, add the following CSS attributes:

.container {
 scroll-snap-type: y mandatory;
}

.child {
 scroll-snap-align: start;
}

Here, the y value simple scroll container snaps to positions in its horizontal axis only, while mandatory means that the visual viewport of this scroll container will rest on a snap point if it isn’t currently scrolled.

You can read more about CSS Scroll Snapping and different property values here.

Let’s look at how we can achieve scroll lock properly by using an NPM package called Body Scroll Lock.

Import the package into your project.


Over 200k developers use LogRocket to create better digital experiences

👁 Image
Learn more →

yarn add body-scroll-lock
// or
npm install body-scroll-lock

Next, create an index.js file and paste in the following code:

const bodyScrollLock = require('body-scroll-lock');
const disableBodyScroll = bodyScrollLock.disableBodyScroll;
const enableBodyScroll = bodyScrollLock.enableBodyScroll;

Then, query select all the elements:

const targetElement = document.querySelector('.child');

// Disable Body Scrolling for the element
disableBodyScroll(targetElement);

// Renable the Scrollin with the library
enableBodyScroll(targetElement);

And that’s all you need to do!

Conclusion

In this article, we learned how we can handle browser compatible scrolling using CSS Scroll Snap and Body Scroll Lock NPM package. Keep Coding!

Get set up with LogRocket's modern error tracking in minutes:

  1. Visit https://logrocket.com/signup/ to get an app ID
  2. Install LogRocket via npm or script tag. LogRocket.init() must be called client-side, not server-side

    $ npm i --save logrocket 
    
    // Code:
    
    import LogRocket from 'logrocket'; 
    LogRocket.init('app/id');
     
    // Add to your HTML:
    
    <script src="https://cdn.lr-ingest.com/LogRocket.min.js"></script>
    <script>window.LogRocket && window.LogRocket.init('app/id');</script>
     
  3. (Optional) Install plugins for deeper integrations with your stack:
    • Redux middleware
    • NgRx middleware
    • Vuex plugin
Get started now
👁 Image
👁 Image
👁 Image

Stop guessing about your digital experience with LogRocket

Get started for free

Recent posts:

Stop hardcoding LLM SDKs: Dynamic LLM routing with OpenRouter and Next.js

Build dynamic LLM routing in Next.js with OpenRouter, TanStack AI, task classification, model fallbacks, and cost-aware routing.

👁 Image
Chizaram Ken
Jun 16, 2026 ⋅ 13 min read

What is TSRX?: What JSX would look like if it were designed today

TSRX adds first-class control flow, conditional hooks, and scoped styles to React via a TypeScript compiler extension — no new framework required.

👁 Image
Ikeh Akinyemi
Jun 12, 2026 ⋅ 6 min read

How to add authentication to a React Native app with Better Auth

Learn how to build a full React Native auth system using Better Auth and Expo — with email/password login, Google OAuth, session persistence, and protected routes.

👁 Image
Chinwike Maduabuchi
Jun 9, 2026 ⋅ 13 min read

AI dev tool power rankings & comparison [June 2026]

Compare the top AI development tools and models of June 2026. View updated rankings, feature breakdowns, and find the best fit for you.

👁 Image
Chizaram Ken
Jun 8, 2026 ⋅ 11 min read
View all posts

Hey there, want to help make our blog better?

Join LogRocket’s Content Advisory Board. You’ll help inform the type of content we create and get access to exclusive meetups, social accreditation, and swag.

Sign up now