Skip to content

Unable to define some attributes on Custom Elements #3919

Closed
@tenphi

Description

@tenphi

Describe the bug
It's unable to define some attributes on 3rd-party Custom Elements.

To Reproduce
Open REPL
I created the simplest Custom Element that do console.log of attribute prefix when connected. But Svelte can't create such attribute because there is a read-only property prefix on HTMLElement prototype. Actually Svelte won't define any attribute if there is a property with the exact name. Instead it will try to assign the value directly to the property.

Expected behavior
It should be possible to create ANY attribute with ANY value that does not contradict the standard.

Information about your Svelte project:

  • Your browser and the version: Chrome 78.0.3904.97

  • Your operating system: MacOS 10.15.1

  • Svelte version: 3.14.0

  • I use Rollup

Severity
I create a UI Framework that based entirely on Custom Elements. That bug is blocking me to use Svelte with it. I love Svelte but I really upset that it contradicts the standard.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions