-
Notifications
You must be signed in to change notification settings - Fork 418
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(sanity): ignore sticky overlay regions with a falsey DOM node #6910
Merged
+11
−5
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
No changes to documentation |
Component Testing Report Updated Jun 12, 2024 3:33 PM (UTC)
|
juice49
requested review from
ricokahler,
a team and
binoy14
and removed request for
a team and
ricokahler
June 12, 2024 15:52
bjoerge
approved these changes
Jun 13, 2024
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.
Thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
There have been some reports that the
StickyOverlay
component is being given regions that have no DOM node (instead, theelement
property isnull
). This causes an error when we attempt to read thescrollTop
property of the element insidegetOffsetsTo
.For affected users, this crashes the entire structure tool when it occurs.
I haven't yet been able to replicate this issue, nor determine the cause. We have a hook named
useReporter
that we use to track the position of field presence indicators. It passes up the value of a ref attached to a DOM node. That ref is read inside a layout effect, so it should never benull
as far as I understand.As an exploratory fix, I've added a condition to
StickyOverlay
to ignore any region that has a falsey DOM node. My hope is this will fix the immediate issue, and once verified, allow us to investigate the underlying cause.What to review
Does this seem like a reasonable interim step to solve and confirm the problem?
Testing
In this instance, I haven't added or changed tests. I don't believe there is an existing test suite for the sticky presence indicators.
However, this branch only adds a filter to ignore any region that has a falsey DOM node. It's defensive and should only have an impact for affected Studios. In all other cases where sticky presence indicators were working, that should remain the case.
You can test this out by making sure the sticky presence indicators still work as expected.