Skip to content

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

Open
oscarmarina wants to merge 1 commit into
webcomponents:masterfrom
oscarmarina:non-string-values
Open

[scoped-custom-element-registry] Non-string Values Are Not Properly Stringified Before Calling attributeChangedCallback in setAttribute#616
oscarmarina wants to merge 1 commit into
webcomponents:masterfrom
oscarmarina:non-string-values

Conversation

@oscarmarina

Copy link
Copy Markdown

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

1 participant