Skip to content

Refactor skeleton removal logic for media elements in image component#2

Open
ElectricKota wants to merge 1 commit into
winduum:mainfrom
ElectricKota:fix-image-behavior
Open

Refactor skeleton removal logic for media elements in image component#2
ElectricKota wants to merge 1 commit into
winduum:mainfrom
ElectricKota:fix-image-behavior

Conversation

@ElectricKota

Copy link
Copy Markdown

Fixed the image skeleton removal logic.

element.onload is usually null until a handler is assigned, mainly with swup, so using it as a condition prevented the load handler from ever being registered. The controller now assigns onload directly for images/iframes, uses oncanplay for videos, and still removes the skeleton immediately when the media is already loaded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant