Commit 5f9db17
committed
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. 01f31d4 is the
diff between approaches here.
DiffTrain build for [3434ff4](3434ff4)1 parent 579b9bf commit 5f9db17
File tree
35 files changed
+1639
-966
lines changed- compiled/facebook-www
- __test_utils__
35 files changed
+1639
-966
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1409 | 1409 | | |
1410 | 1410 | | |
1411 | 1411 | | |
1412 | | - | |
| 1412 | + | |
1413 | 1413 | | |
1414 | 1414 | | |
1415 | 1415 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1409 | 1409 | | |
1410 | 1410 | | |
1411 | 1411 | | |
1412 | | - | |
| 1412 | + | |
1413 | 1413 | | |
1414 | 1414 | | |
1415 | 1415 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
600 | 600 | | |
601 | 601 | | |
602 | 602 | | |
603 | | - | |
| 603 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
600 | 600 | | |
601 | 601 | | |
602 | 602 | | |
603 | | - | |
| 603 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
604 | 604 | | |
605 | 605 | | |
606 | 606 | | |
607 | | - | |
| 607 | + | |
608 | 608 | | |
609 | 609 | | |
610 | 610 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
604 | 604 | | |
605 | 605 | | |
606 | 606 | | |
607 | | - | |
| 607 | + | |
608 | 608 | | |
609 | 609 | | |
610 | 610 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19588 | 19588 | | |
19589 | 19589 | | |
19590 | 19590 | | |
19591 | | - | |
| 19591 | + | |
19592 | 19592 | | |
19593 | 19593 | | |
19594 | | - | |
| 19594 | + | |
19595 | 19595 | | |
19596 | 19596 | | |
19597 | 19597 | | |
| |||
19625 | 19625 | | |
19626 | 19626 | | |
19627 | 19627 | | |
19628 | | - | |
| 19628 | + | |
19629 | 19629 | | |
19630 | 19630 | | |
19631 | 19631 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19359 | 19359 | | |
19360 | 19360 | | |
19361 | 19361 | | |
19362 | | - | |
| 19362 | + | |
19363 | 19363 | | |
19364 | 19364 | | |
19365 | | - | |
| 19365 | + | |
19366 | 19366 | | |
19367 | 19367 | | |
19368 | 19368 | | |
| |||
19396 | 19396 | | |
19397 | 19397 | | |
19398 | 19398 | | |
19399 | | - | |
| 19399 | + | |
19400 | 19400 | | |
19401 | 19401 | | |
19402 | 19402 | | |
| |||
0 commit comments