CrowdStrike / ember-headless-table

https://ember-headless-table.pages.dev
MIT License
23 stars 8 forks source link

Accessing data during form editing #186

Open averydev opened 1 year ago

averydev commented 1 year ago

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.

vitch commented 1 year ago

Is this issue meant to be on CrowdStrike/ember-headless-form?