fix(Image): handle SSR image already complete before inline script runs#1536
Merged
Conversation
|
Size stats
|
|
Deploy preview for mistica-web ready!
Deployed with vercel-action |
|
Accessibility report ℹ️ You can run this locally by executing |
|
Screenshot tests report ✔️ All passing |
The inline <script> rendered after <img> in SSR attached a 'load' listener to set opacity to 1. When the image finished loading before the script was parsed, the listener never fired and the image stayed at opacity 0 — causing flaky snapshot diffs in the SSR acceptance test. Check img.complete first and set opacity synchronously in that case. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
63bf283 to
15c1a85
Compare
ieduardogf
approved these changes
Apr 22, 2026
Collaborator
|
🎉 This PR is included in version 16.61.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
yceballost
pushed a commit
to MurilloLeoni/mistica-web
that referenced
this pull request
Apr 27, 2026
# [16.61.0](Telefonica/mistica-web@v16.60.0...v16.61.0) (2026-04-24) ### Bug Fixes * **Image:** handle SSR image already complete before inline script runs ([Telefonica#1536](Telefonica#1536)) ([ec1e35c](Telefonica@ec1e35c)) ### Features * **chore:** Minimal github conventions ([Telefonica#1530](Telefonica#1530)) ([f7ca38a](Telefonica@f7ca38a)) * **fixedFooterLayout:** include footerScrollEffect prop ([Telefonica#1532](Telefonica#1532)) ([bd56fb2](Telefonica@bd56fb2)) * **llms:** Include source code in mistica package ([Telefonica#1531](Telefonica#1531)) ([bf6280b](Telefonica@bf6280b))
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The inline
<script>rendered after<img>in SSR attached aloadlistener to set the image opacity to1. When the image finished loading before that script was parsed, the listener never fired and the image stayed atopacity: 0, producing flaky snapshot diffs in the SSR acceptance test.Fix
Check
img.completefirst and setopacity = "1"synchronously in that case; fall back to theloadlistener otherwise.Ref: WEB-2429