Conversation
🦋 Changeset detectedLatest commit: 58400ad The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (0.00%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage. @@ Coverage Diff @@
## main #553 +/- ##
=======================================
Coverage 67.86% 67.86%
=======================================
Files 63 63
Lines 974 974
Branches 246 246
=======================================
Hits 661 661
Misses 254 254
Partials 59 59
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an inconsistency in the useSticky hook by replacing the fallback from document.body to viewport dimensions when no container is provided. This ensures consistent behavior regardless of how the document body is styled.
- Replaces
document.bodyfallback with viewport-based dimensions usingwindow.innerHeightandwindow.innerWidth - Removes the parent element validation check since the parent can now be null
- Updates the logic to handle cases where no container is provided by using a synthetic viewport rectangle
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/react-utils/src/useSticky.ts | Updates sticky positioning logic to use viewport dimensions as fallback instead of document.body |
| .changeset/rare-dancers-beam.md | Documents the change for release notes |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
5a8aeef to
3736fd1
Compare
refactor(react-utils): `useSticky` - use `DOMRect` for `pRect`
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Previously, element used to determine stickiness was the
document.body. This worked on sites whosebodywas styled in an opinionated manner. This has been replaced with a representation ofViewportinstead, meaning the dimensions of your browser window over arbitrarybodydimensions, which can overflow / underflow theViewport.