-
-
Notifications
You must be signed in to change notification settings - Fork 116
Fix for jumping Calendar Heatmap #291
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
base: master
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for reaviz-storybook ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
@@ -73,7 +74,17 @@ export const LinearAxis: FC<Partial<LinearAxisProps>> = (props) => { | |||
width: width | |||
}); | |||
|
|||
// Use a ref to track update count to prevent infinite loops | |||
const updateCountRef = useRef(0); |
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.
This feels like a odd way to fix it. Whats triggering this to go in a loop?
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.
useEffect from line 111 and onDimensionsChange
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.
Makes sense but I'm curious what in the heatmap that could be causing this since it seems unique to the heatmap since other charts i've not seen this one.
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.
Pull Request Overview
This PR adds loop prevention logic to the LinearAxis
component to fix the jumping behavior by throttling repeated dimension updates.
- Introduces a
useRef
counter to guard against excessiveupdateDimensions
calls - Adds reset logic when dependencies change to restart the count for each render cycle
I’ve changed the approach for this fix: now we use a |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
bug.mov
What is the new behavior?
No more jumping behavior
Does this PR introduce a breaking change?
Other information