Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update anchored-position.ts to support handling elements outside of document.body in getClippingRect #208

Merged
merged 5 commits into from
Oct 12, 2023

Conversation

EnixCoda
Copy link
Contributor

Hi, thank you for implementing this great project and I've been enjoying using it in my project so far! This time I hope I could contribute back to the project.

My project has encountered such problem EnixCoda/Gitako#294

Minimal demo to reproduce the issue: https://codesandbox.io/s/primer-react-anchor-error-fvxcsf?file=/src/App.tsx

The key point is that the anchor element is outside of document.body. getClippingRect does not expect the element to be not existing and throws error when not found.

@EnixCoda EnixCoda requested review from a team and langermank August 21, 2023 15:09
@changeset-bot
Copy link

changeset-bot bot commented Aug 21, 2023

🦋 Changeset detected

Latest commit: 666c2d7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/behaviors Patch

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

@jonrohan
Copy link
Member

Thanks for the contribution! We just ran into this too, was so happy to find you fixed it already.

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.

2 participants