Skip to content

Conversation

oscarmarina
Copy link

The patched class setAttribute calls attributeChangedCallback without converting value to a string. This can lead to unexpected behavior when passing numeric or otherwise non-string values.

Fixes #607

denilsonsa added a commit to denilsonsa/polyfills that referenced this pull request May 7, 2025
…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