Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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
1 participant