Skip to content

[scoped-custom-element-registry] Stringify values passed to setAttribute()#621

Open
denilsonsa wants to merge 1 commit into
webcomponents:masterfrom
denilsonsa:setAttribute-string
Open

[scoped-custom-element-registry] Stringify values passed to setAttribute()#621
denilsonsa wants to merge 1 commit into
webcomponents:masterfrom
denilsonsa:setAttribute-string

Conversation

@denilsonsa

@denilsonsa denilsonsa commented May 7, 2025

Copy link
Copy Markdown

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

1 participant