Skip to content

Conversation

denilsonsa
Copy link

@denilsonsa denilsonsa commented May 7, 2025

Any value set via setAttribute gets converted to a plain string, because that's how HTML attributes work. However, this polyfil was missing this step, and it was passing the raw non-string value to the custom element attributeChangedCallback. This behavior is wrong, and it is a regression when compared to not using the polyfill.

Fixes #607, supersedes #616. Related: #557

(I should have checked the open PRs before creating this one. Oh, well, this one includes tests, while #616 didn't.)

…ute()

Any value set via `setAttribute` gets converted to a plain string, because
that's how HTML attributes work. However, this polyfil was missing this step,
and it was passing the raw non-string value to the custom element
attributeChangedCallback. This behavior is wrong, and it is a regression when
compared to not using the polyfill.

Fixes webcomponents#607, supersedes webcomponents#616
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.

[scoped-custom-element-registry] Non-string Values Are Not Properly Stringified Before Calling attributeChangedCallback in setAttribute
1 participant