AddThisFeature

Overscroll Control

Stop scrolling inside a panel from taking the whole page with it.

moderate User Experience

What it adds

Explicit scroll-chaining rules for nested scrollable surfaces such as dialogs, drawers, menus, and side panels.

What your agent is told to do

5
  1. 1

    Identify the nested scrolling surfaces where continuing past the end currently drags the page behind them: dialogs, drawers, dropdown menus, chat panes, sidebars, and long tables. Where a surface is both sticky and scrollable, the offsets belong to Safe Sticky Positioning and only the chaining rules belong here.

  2. 2

    Contain the scroll within those surfaces so reaching the end stops the gesture rather than handing it to the page. Contain it rather than forbidding it — the surface itself must still scroll normally throughout.

  3. 3

    Apply the same rule to every input route. Wheel, trackpad momentum, touch drag, and keyboard paging all arrive at the boundary and all must behave identically when they do.

  4. 4

    Preserve and restore the underlying page position whenever a full-screen surface opens and closes, so dismissing a dialog does not return the user to the top of a long list.

  5. 5

    Do not lock scrolling globally by freezing the document while an overlay is open. That approach loses the scroll position, misbehaves on mobile as the address bar collapses, and can leave keyboard users unable to move within the overlay itself.

Edge cases it handles

7
  • Containment must apply only where a surface genuinely scrolls. Applied indiscriminately it makes ordinary page scrolling stop dead wherever the pointer happens to be resting.
  • Suppressing overscroll at the top of the document also disables pull-to-refresh and, on some platforms, back-swipe navigation, so scope the rule to the nested surfaces rather than to the document.
  • Trackpad momentum keeps delivering events after the finger has lifted, so a boundary reached mid-flick will chain unless containment is expressed as a property of the scrolling surface rather than by cancelling individual events.
  • A keyboard user paging through an overlay must still reach its end and then move focus out. Containment applies to scrolling, never to focus movement or to dismissing the surface.
  • Bounce at the end of a list is meaningful feedback on some platforms, and removing it makes the surface feel broken. Suppress the chaining without suppressing the bounce.
  • A surface that grows after opening — a menu whose list is filtered, a dialog that gains a validation summary — must recompute whether it scrolls at all.
  • Zooming changes what overflows: a layout with no nested scrolling at default zoom often acquires it at two hundred percent, and the rules must hold there too.

Definition of done

8
  • Reaching the end of a nested scrolling surface does not scroll the page behind it.
  • Nested surfaces continue to scroll normally within their own bounds.
  • Wheel, trackpad momentum, touch, and keyboard paging all respect the same boundary.
  • Pull-to-refresh and browser navigation gestures still work outside the contained surfaces.
  • Opening and closing an overlay preserves the underlying page scroll position.
  • Keyboard focus can always leave a contained surface.
  • The feature matches the existing design system.
  • No existing functionality is broken.

Related features

How it works

  1. 1

    Copy the link

    Grab the Markdown instruction URL for this feature.

  2. 2

    Give it to your AI

    Paste it into Claude Code, Cursor, v0, Lovable — whatever you build with.

  3. 3

    It inspects, then implements

    Your agent reads your existing app first, then adds the feature to fit it.

Works with your stack

These instructions are written to adapt. They tell the agent to detect your framework, match your existing design system, and reuse what you already have — rather than assuming a particular stack.

Need it tighter than that? Customize the feature and tell it exactly what you're running.