Skip to content

fix(background-image-native): prevent layout shift during lazy image load - #35

Open
Andries-Smit wants to merge 1 commit into
mendix:mainfrom
Andries-Smit:feat/background-image-default-image
Open

fix(background-image-native): prevent layout shift during lazy image load#35
Andries-Smit wants to merge 1 commit into
mendix:mainfrom
Andries-Smit:feat/background-image-default-image

Conversation

@Andries-Smit

@Andries-Smit Andries-Smit commented Mar 23, 2023

Copy link
Copy Markdown
Contributor

Fix: Prevent layout shift during lazy-loaded image display

When lazy-loading images from the server, the absence of a default background image causes visible height changes and layout instability as images load and become visible. This creates a poor user experience and makes content reflow unpredictably.

This PR adds default image support to the image viewer, aligning with common patterns in other viewers. The default image acts as a placeholder, maintaining consistent content height during the image loading phase and preventing layout shifts.

Benefits:

  • Eliminates visible height changes during image load
  • Provides stable layout while fetching images from server
  • Reduces need for workaround solutions (conditional visibility with alternative images)
  • Improves perceived performance and UX

@Andries-Smit
Andries-Smit requested a review from a team as a code owner March 23, 2023 22:08
@Andries-Smit
Andries-Smit force-pushed the feat/background-image-default-image branch from c0ae454 to 6d86966 Compare March 28, 2023 18:33
@Andries-Smit
Andries-Smit force-pushed the feat/background-image-default-image branch from 6d86966 to d2ea5fa Compare June 4, 2025 14:29
@Andries-Smit
Andries-Smit force-pushed the feat/background-image-default-image branch from d2ea5fa to c413ef0 Compare February 27, 2026 10:27
@Andries-Smit
Andries-Smit force-pushed the feat/background-image-default-image branch from c413ef0 to a39ad46 Compare July 1, 2026 14:25
@Andries-Smit Andries-Smit changed the title feat(background-image-native): add default image fix(background-image-native): add default image Sep 2, 2026
@Andries-Smit
Andries-Smit force-pushed the feat/background-image-default-image branch from a39ad46 to d084228 Compare September 2, 2026 07:20
@Andries-Smit Andries-Smit changed the title fix(background-image-native): add default image fix(background-image-native): prevent layout shift during lazy image load Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants