-
Notifications
You must be signed in to change notification settings - Fork 497
fix: implement virtualized array list with visibility detection when ancestors change hidden state #11166
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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
3 Skipped Deployments
|
🧪 E2E Preview environment🔑 Environment Variables for Local TestingThis is the preview URL for the E2E tests: https://e2e-studio-1ez3hjvlu.sanity.dev To run the E2E tests locally, you can use the following environment variables, then run 💬 Remember to build the project first with |
🧪 E2E Preview environmentWaiting for preview deployment to finish… |
📊 Playwright Test ReportThis report contains test results, including videos of failing tests. |
📊 Playwright Test ReportWaiting for E2E tests to finish… |
⚡️ Editor Performance ReportUpdated Tue, 18 Nov 2025 20:17:50 GMT
Detailed information🏠 Reference resultThe performance result of
🧪 Experiment resultThe performance result of this branch
📚 Glossary
|
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||
… ancestors change hidden state
…ed before observing
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 is mostly just what was removed from ListArrayInput. Abstracted to a separate component since it was being rendered in 2 different places now within ListArrayInput
ad3079d to
3f09093
Compare
stipsan
left a comment
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.
A very nice fix indeed :chefs-kiss:
Description
Some issues occur with arrays of objects when the field is wrapped within a controlled visibility parent. eg. if wrapped in a
sanity/ui'sTabPanelwhere the recommended approach is to control the hidden prop (https://www.sanity.io/ui/docs/component/tab#tab-panel).The issue is that virtualization of the array of objects is done based on the initial render. If the field is hidden, that screws up the sizing calculations.
This PR adds a new hook, which uses ReziseObserver to detect when the array of objects field changes visibility and will then re-mount the component to ensure accurate virtualization
What to review
Testing
Before:

[Scrolling along with some other interactions like drag/drop, would trigger a resize and would resolve the issue on completion]
After:

Notes for release
Fixes as issue where arrays of objects would sometimes not show all items in the list of objects when rendered within a visibility controlled parent.