Skip to content

Accessing data during form editing #186

@averydev

Description

@averydev

Hi there!

One issue I've come across is needing to access the current state of the data from the form before it's been submitted to make it more responsive to user input.

Here's an example of what would be really nice to do:

<HeadlessForm @data={{this.data}}  @onSubmit={{this.submitForm}} as |form|>
    <form.Field @name="firstName">
            <field.Input />
    </form.Field>

    {{#if form.data.firstName}}
        <form.Field @name="lastName">
            <field.Input />
        </form.Field>
    {{/if}}
</HeadlessForm>

I think the only way to do it now is by setting @dataMode="mutable" which would be nice if it wasn't mutually exclusive.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions