sanity
sanity copied to clipboard
Image field causes layout shifts when opening a document
Describe the bug When opening a document with an image field above the fold you can visibly see the image field seemingly being mounted, unmounted and mounted again, causing unappealing layout shifts.
Here's a video. It's very quick so I recommend scrubbing to see the behaviour. https://github.com/user-attachments/assets/4aeee8b0-c5e0-49ef-bb93-cbc87d8a7116
To Reproduce
- Create a document type with an image field as the first field
- Create two documents
- Add an image to the image field in each document
- Use the document list to change between the two documents
- Witness the flicker and layout shifts
Expected behavior Image should not be mounted twice, and there should be no layout shifts.
Which versions of Sanity are you using? 3.53
What operating system are you using? MacOs Sonoma, Arc browser