-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix useResizeObserver loop limit exceeded warning #2891
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
Conversation
Build successful! 🎉 |
Build successful! 🎉 |
Build successful! 🎉 |
Build successful! 🎉 |
Hi anyone knows when this pr will be merge please ? |
Build successful! 🎉 |
Build successful! 🎉 |
Build successful! 🎉 |
Build successful! 🎉 |
Build successful! 🎉 |
Build successful! 🎉 |
Build successful! 🎉 |
Build successful! 🎉 |
Build successful! 🎉 |
## API Changes
unknown top level export { type: 'identifier', name: 'Column' } |
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.
LGTM, confirmed the loop limit warning appeared before the fix in the new resize observer stories and goes away with the new changes. Also verified that other components seem to collapse/resize just fine still
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.
The code makes sense and the new test prevents the error in Chrome, Firefox, and Safari
@snowystinger this is great, thank you ! |
Closes #1924
Current:
Use a raf to avoid unobserving and reobserving constantly
Old:
Uses solution from https://blog.elantha.com/resizeobserver-loop-limit-exceeded/
Story added is based on the code from the blog and it reproduces the issue. You can see this for yourself once this PR builds.
Someone pinged on the issue again and our project's complain about this periodically. I had a solution laying around so put it into a PR. This isn't a priority for our next release, but is a general nice to have.
✅ Pull Request Checklist:
📝 Test Instructions:
Make sure ActionGroups still collapse as expected. Shouldn't see any warnings about loop limit exceeded.
Other components using it that should be verified in testing:
ActionGroup
ScrollView
SearchAutocomplete
Breadcrumbs
ButtonGroup
CardBase
ColorWheel
ComboBox
DatePicker
Picker
SearchWithin
Tabs
🧢 Your Project: