-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
fix(platform): Avoid IntersectionObserver issues #13420
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
| const headings = tocItems.map(item => item.element); | ||
| headings.forEach(heading => observer.observe(heading)); | ||
| return () => headings.forEach(heading => observer.unobserve(heading)); | ||
| return () => observer.disconnect(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is better, we can tear down the whole observer like this I believe? I can't even find unobserve here: https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver/disconnect 🤔
Bundle ReportChanges will decrease total bundle size by 19 bytes (-0.0%) ⬇️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: sentry-docs-server-cjsAssets Changed:
view changes for bundle: sentry-docs-client-array-pushAssets Changed:
Files in
|
chargome
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's try!
| const rootMarginBottomRaw = (2 / 3) * window.innerHeight - rootMarginTop; | ||
| const rootMarginBottom = Math.floor(rootMarginBottomRaw); | ||
| const rootMarginBottomRaw = (2 / 3) * innerHeight - rootMarginTop; | ||
| const rootMarginBottom = Math.floor(rootMarginBottomRaw) * -1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strange that we still run into this, I thought the floor call here fixed this 🤔
We have a lot of issues like this: https://sentry.sentry.io/issues/5543047544/?project=1267915 TBH not sure how that happens, but I guess we can try to be defensive here. Maybe inner height is missing somehow?
2a93bf0 to
4fa0baa
Compare
We have a lot of issues like this: https://sentry.sentry.io/issues/5543047544/?project=1267915 TBH not sure how that happens, but I guess we can try to be defensive here. Maybe inner height is missing somehow?
We have a lot of issues like this: https://sentry.sentry.io/issues/5543047544/?project=1267915
TBH not sure how that happens, but I guess we can try to be defensive here. Maybe inner height is missing somehow?