Skip to content

Setting properties to custom elements wont work when using spreads #16590

@edoardocavazza

Description

@edoardocavazza

Describe the bug

Hello! I found out that Svelte does not use the set_custom_element_data helper when spreading a variabile to a custom element.
In particular, this doesn't work for camel case properties because the set_attributes method lowercases the property name. I'm not sure if this is the expected behavior. If so, I think it might be better to check that the attribute is among the element's setters before calling normalize_attribute here.

Reproduction

https://svelte.dev/playground/707b184533634e3fad230e91eecd3901?version=5.38.0

Logs

System Info

REPL

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions