webcomponents / webcomponents/polyfills
[scoped-custom-element-registry] Non-string Values Are Not Properly Stringified Before Calling attributeChangedCallback in setAttribute
Open
Focus Area: Standards & Polyfills
Type: Bug
- Dominant language
- HTML
- Stars
- 1.2k
- Forks
- 168
- PR merge metrics
- No merged PRs in 30d
Description
### Description
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.
### Example
[Playground ](https://lit.dev/playground/#gist=c71f7fd23f3209a5a7bb67d1e8b0e37b)
### Steps to reproduce
#### Expected behavior
> Similar to `toggleAttribute`, a preliminary step `const newValue = this.getAttribute(name)` is added for use in `attributeChangedCallback`.
#### Actual behavior
Contributor guide
Assessment
This issue has not been assessed yet.