Skip to content

Add hook to observe multiple intersections#165

Draft
marlonschlosshauer wants to merge 1 commit intomainfrom
allow-multiple-intersection-observations
Draft

Add hook to observe multiple intersections#165
marlonschlosshauer wants to merge 1 commit intomainfrom
allow-multiple-intersection-observations

Conversation

@marlonschlosshauer
Copy link
Contributor

We currently have a neat hook to check for the intersection of a single element (via a ref). For another project we needed to check which of many elements, are intersecting.

Example: We have an RTE with headlines. We want to show which headline is currently visible & highlight it in a table of contents.

FYI: The current code is lifted from that other project and slightly modified to somewhat fit the shape of the existing useIntersection hook.

Todos:

  • Validate current strategy
  • Add support for remaining props
  • Test

@changeset-bot
Copy link

changeset-bot bot commented Oct 2, 2025

⚠️ No Changeset found

Latest commit: 94d871f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@marlonschlosshauer marlonschlosshauer added the UI this PR has UI related changes label Dec 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

good-first-issue UI this PR has UI related changes work-in-progress

Development

Successfully merging this pull request may close these issues.

1 participant