react/fixtures/dom
Jack Pope 3434ff4f4b
Add scrollIntoView to fragment instances (#32814)
This adds `experimental_scrollIntoView(alignToTop)`. It doesn't yet
support `scrollIntoView(options)`.

Cases:
- No host children: Without host children, we represent the virtual
space of the Fragment by attempting to scroll to the nearest edge by
using its siblings. If the preferred sibling is not found, we'll try the
other side, and then the parent.
- 1 or more host children: In order to handle the case of children
spread between multiple scroll containers, we scroll to each child in
reverse order based on the `alignToTop` flag.

Due to the complexity of multiple scroll containers and dealing with
portals, I've added this under a separate feature flag with an
experimental prefix. We may stabilize it along with the other APIs, but
this allows us to not block the whole feature on it.

This PR was previously implementing a much more complex approach to
handling multiple scroll containers and portals. We're going to start
with the simple loop and see if we can find any concrete use cases where
that doesn't suffice. 01f31d43013ba7f6f54fd8a36990bbafc3c3cc68 is the
diff between approaches here.
2025-08-27 18:05:57 -04:00
..
public [fix] replace polyfill.io with cloudflare equivalent (#30123) 2024-06-28 10:26:28 +02:00
src Add scrollIntoView to fragment instances (#32814) 2025-08-27 18:05:57 -04:00
.gitignore act() - s / flushPassiveEffects / Scheduler.unstable_flushWithoutYielding (#15591) 2019-05-16 17:12:36 +01:00
package.json Fix local react usage in DOM fixture (#32080) 2025-01-16 10:33:24 -05:00
README.md [UMD] Remove umd builds (#28735) 2024-04-17 11:15:27 -07:00
yarn.lock Fix local react usage in DOM fixture (#32080) 2025-01-16 10:33:24 -05:00

DOM Fixtures

A set of DOM test cases for quickly identifying browser issues.

Setup

To reference a local build of React, first run yarn build at the root of the React project. Then:

cd fixtures/dom
yarn
yarn dev

The dev command runs a script that copies over the local build of react into the public directory.