test(parallax): pin #2052 sticky-layer-in-component regression#2530
Merged
Conversation
Add a skipped e2e test reproducing #2052: a sticky ParallaxLayer wrapped in a component lands inside the scrolling content instead of as a sibling of it, so it scrolls away between its start and end offsets. Parallax splits DOM placement by reading child.props.sticky while walking children with React.Children.map, which traverses the static element tree and never renders components — so a wrapped layer's sticky prop is invisible. The test documents the contract and is skipped until a real fix (moving the placement decision into the layer, e.g. createPortal) lands.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Pin the bug behind #2052 with a regression test so the contract is captured in the repo. A sticky
ParallaxLayerwrapped in a component renders inside the scrolling content instead of as a sibling of it, so it scrolls away and vanishes between itsstartandendoffsets — matching the long-running user reports on the issue.Parallaxdecides DOM placement by readingchild.props.stickywhile walking children withReact.Children.map. That walk traverses the static element tree and never renders components, so a wrapped layer'sstickyprop is invisible to it. Fragments work because their children are static; a component's output is not.The test is
it.skip'd on purpose: it documents the correct placement contract and serves as the unskip target once a real fix lands. The fix is intentionally out of scope here — it requires moving the placement decision into the layer itself (e.g.createPortalinto a sticky container), which is a rearchitecture with its own breakage surface (DOM structure, layer registration lifecycle,ref.current.content, SSR).Notes