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

fix(docs): useIsOverflow unsubscribe if ref changes #33630

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

mathis-m
Copy link
Contributor

Previous Behavior

While the previous examle is working fine for the example use-case, the hook might need adjustment when used in real world usecase.

IF: element to observe changes, eg. when rendered in different place (e.g. wrapped contitionally)
IT WILL: Evaluate the overflow based on the not mounted element. It as well does not observe any changes to the new Element.
BECAUSE: This hook stores a JS ref to the element. RO will only automaticaly unobserve if no JS ref to the element exists (see w3c/csswg-drafts#5155 (comment)).

New Behavior

Unobserve element if needed and observe new element, calculate overflow based on new element.

Related Issue(s)

  • Fixes #

@mathis-m mathis-m requested a review from a team as a code owner January 13, 2025 14:53
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.

1 participant