fix(compiler): fix attachInternals should be usable without formAssoc…
Ticket: #6285
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.
Improvement: Add stencil support for custom 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
Does this introduce a breaking change?
- [ ] Yes
- [X] No
Testing
Manual testing / changing code in node_modules
Also could we update the docs as they should be clarify that element internals can be used without form association.
@pfteter mind running npm run prettier and check in the changes?