Skip to content

docs: add documentation on using the FormAssociated class #7198

@mvolkmann

Description

@mvolkmann

🙋 Documentation Request

As far as I can tell, the proper way to use the FormAssociated class in a FAST web component is to:

  1. add import { FormAssociated } from "@microsoft/fast-foundation";
  2. change extends FASTElement to extends FormAssociated(FASTElement)
  3. add the property private internals: ElementInternals = this.elementInternals;
  4. call this.internals.setFormValue(initialValue); in connectedCallback to set the initial value
  5. call this.internals.setFormValue(newValue); every time the value changes

I tried all of this, but TypeScript doesn't like changes 2 and 3.

Where can I find an example of using the FormAssociated class or any documentation on it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    community:good-first-issueGood issues for first time contributorscommunity:requestIssues specifically reported by a member of the community.docs:exampleTutorial and example work

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions