Skip to content

feat: add scroll and wheel interactions - #1328

Open
sergnio wants to merge 2 commits into
testing-library:mainfrom
sergnio:feat/support-scroll-user-event
Open

feat: add scroll and wheel interactions#1328
sergnio wants to merge 2 commits into
testing-library:mainfrom
sergnio:feat/support-scroll-user-event

Conversation

@sergnio

@sergnio sergnio commented Sep 4, 2026

Copy link
Copy Markdown

What

  • Add userEvent.scroll() to set an element's scroll position and dispatch scroll.
  • Add userEvent.wheel() to dispatch wheel input with deltas and modifier state.

Why

Enable tests to model scroll and wheel interactions without relying on unsupported JSDOM layout calculations.

How

  • Register scroll and wheel with the event factory, including resilient WheelEvent initialization.
  • Cover setup and direct APIs, event defaults, explicit wheel delta modes, modifier state, and scroll dispatch behavior.
  • Deliberately do not calculate layout, scroll limits, or intermediate scroll positions.

Checklist

  • Documentation
  • Tests
  • Ready to be merged

@sergnio
sergnio force-pushed the feat/support-scroll-user-event branch 2 times, most recently from a3c7d5c to 2c787c7 Compare September 4, 2026 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant