Skip to content

fix(ui5-avatar-badge): handle delayed icon collection loading#13405

Merged
kgogov merged 1 commit intomainfrom
fix/avatar-badge-async-icon-loading
Apr 20, 2026
Merged

fix(ui5-avatar-badge): handle delayed icon collection loading#13405
kgogov merged 1 commit intomainfrom
fix/avatar-badge-async-icon-loading

Conversation

@kgogov
Copy link
Copy Markdown
Contributor

@kgogov kgogov commented Apr 17, 2026

When an icon collection loader was registered but had not yet resolved, getIconDataSync() returned undefined and the sync onBeforeRendering immediately set invalid=true, permanently hiding the badge. Nothing ever cleared the flag because onBeforeRendering never re-ran.

Fix: make onBeforeRendering async and fall back to await getIconData() when the sync lookup misses. The framework renders with the default invalid=false while the loader is pending, and the badge stays visible. Once the loader resolves the async continuation sets invalid correctly.

Adds a Cypress regression test using a controlled deferred promise to verify the badge is never hidden while the loader is pending and the icon renders correctly after resolution.

Fixes #13401

When an icon collection loader was registered but had not yet resolved,
getIconDataSync() returned undefined and the sync onBeforeRendering
immediately set invalid=true, permanently hiding the badge. Nothing ever
cleared the flag because onBeforeRendering never re-ran.

Fix: make onBeforeRendering async and fall back to await getIconData()
when the sync lookup misses. The framework renders with the default
invalid=false while the loader is pending, and the badge stays visible.
Once the loader resolves the async continuation sets invalid correctly.

Adds a Cypress regression test using a controlled deferred promise to
verify the badge is never hidden while the loader is pending and the
icon renders correctly after resolution.

Fixes #13401
@ui5-webcomponents-bot
Copy link
Copy Markdown
Collaborator

ui5-webcomponents-bot commented Apr 17, 2026

🧹 Preview deployment cleaned up: https://pr-13405--ui5-webcomponents.netlify.app

@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview April 17, 2026 09:17 Inactive
@NakataCode NakataCode self-requested a review April 17, 2026 12:53
@NakataCode
Copy link
Copy Markdown
Contributor

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

🤖 Generated with Claude Code

@kgogov kgogov merged commit e4fba6a into main Apr 20, 2026
21 of 22 checks passed
@kgogov kgogov deleted the fix/avatar-badge-async-icon-loading branch April 20, 2026 10:16
@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview April 20, 2026 10:16 Inactive
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.

ui5-avatar-badge remains hidden when icon is not yet loaded at render time

3 participants