polyfills icon indicating copy to clipboard operation
polyfills copied to clipboard

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

Open oscarmarina opened this issue 9 months ago • 0 comments

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

Steps to reproduce

Expected behavior

Similar to toggleAttribute, a preliminary step const newValue = this.getAttribute(name) is added for use in attributeChangedCallback.

Image

Actual behavior

Image

oscarmarina avatar Jan 24 '25 12:01 oscarmarina