Skip to content

Gallery: Flash of white when image is uploaded #11650

@noisysocks

Description

@noisysocks

Describe the bug
After the Gallery block finishes uploading an image, it swaps the temporary blob: image with the real http:// image. This causes a flash of white on slow to medium connections while the new image loads.

To Reproduce

  1. Simulate a Fast 3G connection
  2. Insert a Gallery block
  3. Upload a few images

Expected behavior
I'd expect the images to appear with some indication that they are loading (seperate issue: #8810), and then for the temporary image to be seamlessly replaced with the real image.

Actual behaviour
There is a flash of white while the temporary image is swapped out with the real image.

Screenshots
gallery

Additional context
We can do this by loading the real image using new Image() before inserting it into the DOM.

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Block] GalleryAffects the Gallery Block - used to display groups of images[Feature] MediaAnything that impacts the experience of managing media[Type] EnhancementA suggestion for improvement.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions