We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents f38c876 + 8f85b8f commit ea34d83Copy full SHA for ea34d83
apps/website/src/components/toc/toc.tsx
@@ -30,13 +30,16 @@ const useActiveItem = (itemIds: string[]) => {
30
const activeId = useSignal<string>();
31
32
useVisibleTask$(({ cleanup }) => {
33
- const observer = new IntersectionObserver((entries) => {
34
- entries.forEach((entry) => {
35
- if (entry.isIntersecting) {
36
- activeId.value = entry.target.id;
37
- }
38
- });
39
+ const observer = new IntersectionObserver(
+ (entries) => {
+ entries.forEach((entry) => {
+ if (entry.isIntersecting) {
+ activeId.value = entry.target.id;
+ }
+ });
40
+ },
41
+ { rootMargin: `0% 0% -90% 0%` },
42
+ );
43
44
itemIds.forEach((id) => {
45
const element = document.getElementById(id);
0 commit comments