Skip to content
  • Home
  • About
  • No Access
  • Privacy Policy
Bits of .NET
Bits of .NET
  • Asp.Net Core
  • C#
  • SQL
  • JavaScript
  • CSS
  • About
  • ErcanOPAK.com
  • No Access
  • Privacy Policy

Bits of .NET

Daily micro-tips for C#, SQL, performance, and scalable backend engineering.

  • Asp.Net Core
  • C#
  • SQL
  • JavaScript
  • CSS
  • About
  • ErcanOPAK.com
  • No Access
  • Privacy Policy
CSS

CSS: Fix a Sticky Header Jittering During Momentum Scroll on iOS

- 17.11.26 - ErcanOPAK

🎨 CSS: Fix a Sticky Header Jittering During Momentum Scroll on iOS

A position: sticky header that looks rock-solid on desktop can visibly jitter or flicker during iOS Safari’s momentum scrolling, especially once a backdrop-filter blur is involved, because the browser’s compositor has to repaint that blurred layer on nearly every scroll frame instead of simply repositioning an already-composited layer — and momentum scrolling on iOS fires scroll position updates at a much higher effective rate than a normal drag, which is exactly the frame budget a per-frame repaint can’t keep up with.

🔎 The Problem

.site-header {
  position: sticky;
  top: 0;
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.7);
}
/* no explicit compositing hint - the browser decides on its own
   whether this layer gets its own compositor layer or gets
   repainted inline with the rest of the scrolling content */

âś… Fix: Give the Sticky Header Its Own Compositor Layer

  • Add transform: translateZ(0) or will-change: transform to the sticky element to hint the browser into promoting it to its own compositor layer, so scrolling repositions an existing layer instead of repainting the blur on every frame.
  • Check every ancestor for overflow: hidden or overflow: auto — a clipping ancestor between the sticky element and the scroll container can force extra layout/paint work during momentum scroll that a plain sticky element without one wouldn’t trigger.
  • If jitter persists specifically with backdrop-filter applied, test with the blur temporarily removed; if the jitter disappears, the blur’s per-frame repaint cost is the bottleneck, and a cheaper solid or gradient background may be the more reliable trade-off on iOS specifically.

🚨 Why This Is Dangerous

  • Shipping a sticky header that tests perfectly smooth on every desktop browser and in the simulator, only to visibly stutter for real iPhone users during momentum scroll — a device-specific compositing cost that desktop dev tools and most simulators simply don’t reproduce.

Sticky positioning is cheap — repainting a blur underneath it on every scroll frame isn’t.

— UI Engineer

Related posts:

CSS Container Queries — The Future of Responsive Design

CSS Container Queries — The Future of Responsive Design

CSS “Absolute Element Misaligned” — The position: relative Curse

CSS “Absolute Element Misaligned” — The position: relative Curse

CSS: Fix a Flex Item Ignoring max-width Because min-width Defaults to auto and Wins the Comparison

CSS: Fix a Flex Item Ignoring max-width Because min-width Defaults to auto and Wins the Comparison

Views: 6

Post navigation

Windows 11: Fix File Explorer Losing Saved Folder View Settings
Kubernetes: Fix a CronJob Silently Skipping Runs After a Time Change

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

November 2026
M T W T F S S
 1
2345678
9101112131415
16171819202122
23242526272829
30  
« Oct    

Most Viewed Posts

  • How to make theater mode the default for Youtube (1,059)
  • Get the User Name and Domain Name from an Email Address in SQL (983)
  • How to add default value for Entity Framework migrations for DateTime and Bool (981)
  • Get the First and Last Word from a String or Sentence in SQL (861)
  • How to select distinct rows in a datatable in C# (856)
  • How to enable, disable and check if Service Broker is enabled on a database in SQL Server (658)
  • Add Constraint to SQL Table to ensure email contains @ (613)
  • Average of all values in a column that are not zero in SQL (571)
  • How to use Map Mode for Vertical Scroll Mode in Visual Studio (549)
  • Find numbers with more than two decimal places in SQL (477)

Recent Posts

  • Visual Studio: Fix Quick Actions Hiding Behind a Stale Squiggle
  • Photoshop: Fix a Smart Filter Resetting After You Relink It
  • Ajax: Fix a Cancelled Request Still Updating Stale UI State
  • C#: Fix a Span Captured by a Lambda Throwing at Runtime
  • The AI Prompt That Converts a REST Endpoint Into a Typed SDK
  • Git: Fix a Worktree Locking a Branch Needed Somewhere Else
  • Asp.Net Core: Fix a Background Service Leaking Scoped Dependencies
  • SQL Server: Fix a Columnstore Index Fragmenting After Bulk Deletes
  • Docker: Fix a Container Losing Logs After a Restart Policy
  • Asp.Net Core: Fix Output Caching Serving a Stale Authorized Page

Most Viewed Posts

  • How to make theater mode the default for Youtube (1,059)
  • Get the User Name and Domain Name from an Email Address in SQL (983)
  • How to add default value for Entity Framework migrations for DateTime and Bool (981)
  • Get the First and Last Word from a String or Sentence in SQL (861)
  • How to select distinct rows in a datatable in C# (856)

Recent Posts

  • Visual Studio: Fix Quick Actions Hiding Behind a Stale Squiggle
  • Photoshop: Fix a Smart Filter Resetting After You Relink It
  • Ajax: Fix a Cancelled Request Still Updating Stale UI State
  • C#: Fix a Span Captured by a Lambda Throwing at Runtime
  • The AI Prompt That Converts a REST Endpoint Into a Typed SDK

Social

  • ErcanOPAK.com
  • GoodReads
  • LetterBoxD
  • Linkedin
  • The Blog
  • Twitter
© 2026 Bits of .NET | Built with Xblog Plus free WordPress theme by wpthemespace.com