Skip to content

fix(runtime): keep empty attributes on boolean | string props (#6963) - #6968

Merged
johnjenkins merged 5 commits into
stenciljs:mainfrom
Elements2720:fix/custom-elements-empty-union-attr
Nov 11, 2026
Merged

johnjenkins merged 5 commits into
stenciljs:mainfrom
Elements2720:fix/custom-elements-empty-union-attr

Conversation

@Elements2720

Copy link
Copy Markdown
Contributor

Summary

attributeChangedCallback now treats only strict equality and nullish pairs as unchanged, so an empty string remains distinct from false for boolean|string props. Added a dist-custom-elements browser regression test.

Evidence

  • Before: focused Wdio spec failed with Expected empty string and Received false.
  • After: focused Wdio spec passed in Chrome 155 (1 passing); full Jest passed (252 suites, 4172 tests, 22 snapshots).

Merge Danger

Door: two-way

Blast Radius: runtime

Fixes #6963

@Elements2720
Elements2720 requested a review from a team as a code owner October 20, 2026 01:24
@johnjenkins johnjenkins changed the title fix(runtime): preserve empty union attributes in custom elements (#6963) fix(runtime): keep empty attributes on boolean | string props (#6963) Nov 10, 2026

@johnjenkins johnjenkins 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.

LGTM - I added a couple more test cases - thanks for contributing to Stencil!

@johnjenkins
johnjenkins disabled auto-merge November 11, 2026 09:46
@johnjenkins
johnjenkins added this pull request to the merge queue Nov 11, 2026
Merged via the queue into stenciljs:main with commit 8b1bdb4 Nov 11, 2026
31 checks passed
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.

bug: empty attribute is ignored on a boolean | string prop in dist-custom-elements (regression in 4.38.0)

2 participants