Skip to content

fix[image]: ENG-13637 render empty alt attributes when alt text is not provided - #4818

Open
floating-dynamo wants to merge 1 commit into
mainfrom
ENG-13637-image-alt
Open

fix[image]: ENG-13637 render empty alt attributes when alt text is not provided#4818
floating-dynamo wants to merge 1 commit into
mainfrom
ENG-13637-image-alt

Conversation

@floating-dynamo

@floating-dynamo floating-dynamo commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Description

  • Render alt="" for Gen 1 and Gen 2 Image components when alt text is not provided, while preserving populated alt text.

Link to JIRA ticket (if applicable):
https://builder-io.atlassian.net/browse/ENG-13637

Screenshot/Clip
image

Chrome DevTools displays the empty attribute as alt, which is valid HTML and equivalent to alt="". The DOM confirms that the attribute exists with an empty-string value - Reference

@floating-dynamo
floating-dynamo requested a review from a team August 20, 2026 07:53
@floating-dynamo floating-dynamo self-assigned this Aug 20, 2026
@floating-dynamo
floating-dynamo requested review from AishwaryaParab, lihuelg and sanyamkamat and removed request for a team August 20, 2026 07:53
@changeset-bot

changeset-bot Bot commented Aug 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9e06dac

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
@builder.io/react Patch
@builder.io/sdk-angular Patch
@builder.io/sdk-react-nextjs Patch
@builder.io/sdk-qwik Patch
@builder.io/sdk-react Patch
@builder.io/sdk-solid Patch
@builder.io/sdk-svelte Patch
@builder.io/sdk-vue Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@nx-cloud

nx-cloud Bot commented Aug 20, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 9e06dac

Command Status Duration Result
nx test @builder.io/sdks ✅ Succeeded 14s View ↗
nx typecheck @builder.io/sdks ✅ Succeeded 7s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-08-20 09:43:43 UTC

@builder-io-integration builder-io-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Builder reviewed your changes — looks good ✅

Review Details

Code Review Summary

PR #4818 updates the Gen 1 React Image component and the SDK/Gen 2 lite Image component to emit an explicit empty alt attribute when no alt text is provided, while preserving supplied alt text. The implementation is small and consistent across the two HTML renderers, and the existing presentation behavior for decorative images remains aligned with the empty-alt case.

This is a standard-risk accessibility/UI behavior change. The added unit, snapshot, and SDK end-to-end coverage exercises both missing and populated alt text, and the React Native E2E case is appropriately skipped because it does not render HTML image attributes. Two independent reviews found no confirmed bugs, security concerns, or performance regressions.

🧪 Browser testing: Will run after this review (PR touches UI code)

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.

2 participants