Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessing data during form editing #186

Open
averydev opened this issue May 18, 2023 · 1 comment
Open

Accessing data during form editing #186

averydev opened this issue May 18, 2023 · 1 comment

Comments

@averydev
Copy link

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
Copy link
Contributor

vitch commented May 18, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants