Skip to content

Sheet: stays entering, off-screen, when its arrival scroll is interrupted #11015

Open

Description

@rodrigoscna

Provide a general summary of the issue

Sheet (react-aria-components 1.22.1) can stay entering for good, with its panel off the window and focus held back from everything inside it. That happens when the smooth scroll that brings it in is interrupted before it ends.

🤔 Expected Behavior?

A sheet that opens finishes entering, and its panel rests where it opens, even when something scrolls its scroller, or moves focus inside it, while it arrives.

😯 Current Behavior

In dist/private/Sheet.mjs, onEnter scrolls [data-sheet-scroll] smoothly to the rest position. It then returns a promise that resolves only on that scroller's next scrollend. With UNSTABLE_deferUntilEntered and UNSTABLE_overrideFocus set, nothing inside the sheet takes focus until then.

In Chromium, without reduced motion, a sheet that opens with the page, from a route, can be interrupted this way. If a button inside it is focused and pressed while the panel is still arriving, the smooth scroll stops, and the panel stays where it was, off the right edge of the window, with its scrim over the page. Here the button opens a Menu. In our tests this happened every time we pressed during the arrival, 30 runs out of 30, and on a loaded CI machine for an ordinary test. The menu then opens at the window's edge with none of its items focused.

💁 Possible Solution

Don't rely on a single scrollend. If the scroller isn't at its rest position when the arrival should have ended, or when its scroll stops short of it, scroll it there instantly and resolve the enter. Under reduced motion the scroll is already instant, so nothing changes there.

🔦 Context

Our current workaround watches each [data-sheet-scroll] as it mounts. If the scroller is not at rest after its scroll has stalled for 400 ms, or after 1.5 s, it calls scrollTo({ ..., behavior: 'instant' }) to the rest position. That fires the scrollend the enter waits on.

🖥️ Steps to Reproduce

  1. Render a Sheet (side sheet, position="right") that is open on mount, as a page loads, with a MenuTrigger button inside it.
  2. Before the arrival's smooth scroll ends, focus the button and press Enter (Playwright: focus() then keyboard.press('Enter') right after hydration).
  3. The panel stays off-screen, and the sheet never finishes entering.

Version

react-aria-components 1.22.1

What browsers are you seeing the problem on?

Chrome

If other, please specify.

Chromium (Playwright's headless shell)

What operating system are you using?

Linux

🧢 Your Company/Team

No response

🕷 Tracking Issue

No response

Activity

  1. nwidynski commented on Nov 23, 2026

    @nwidynski
    Contributor

    Before the arrival's smooth scroll ends, focus the button and press Enter

    Is this a hypothetical failure scenario or did you encounter this during normal use? If so, could you please provide a realistic scenario and ideally a reproduction sandbox for it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions