Skip to content

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

@oscarmarina

Description

@oscarmarina

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions