Skip to content

feat: Support CustomStateSet #6285

@pfteter

Description

@pfteter

Prerequisites

Stencil Version

4.33

Current Behavior

@AttachInternals() internals!: ElementInternals;

cannot be used without
formAssociated: true in the metadata.

because of a condition in the compiler

Expected Behavior

@AttachInternals() internals!: ElementInternals;

should work without formAssociated: true in the metadata.

CustomStateSet can now be used without formAssociated for components that are not formAssociated.

Future improvement: Add stencil support for custom state / :state().

System Info

Steps to Reproduce

add

@AttachInternals() internals!: ElementInternals;

to a component, an console error will be shown

Code Reproduction URL

Additional Information

Will commit a fix for it, the solution is quite easy:
https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/attachInternals

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