Fix useResizeObserver loop limit exceeded warning#2891
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' } |
LFDanLu
left a comment
There was a problem hiding this comment.
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
ktabors
left a comment
There was a problem hiding this comment.
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: