sanity icon indicating copy to clipboard operation
sanity copied to clipboard

Image field causes layout shifts when opening a document

Open jorngeorg opened this issue 6 months ago • 0 comments

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

  1. Create a document type with an image field as the first field
  2. Create two documents
  3. Add an image to the image field in each document
  4. Use the document list to change between the two documents
  5. 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

jorngeorg avatar Aug 07 '24 20:08 jorngeorg