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

Yield the current form data #379

Open
simonihmig opened this issue May 22, 2024 · 1 comment
Open

Yield the current form data #379

simonihmig opened this issue May 22, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@simonihmig
Copy link
Contributor

Currently, the form data as changed by the user, is only available for the @onSubmit callback (unless you are in mutable mode). We could yield this.effectiveData though to give access to that data to the template, for e.g. dynamic forms that render/unrender new form elements based on the user input.

@simonihmig simonihmig added the enhancement New feature or request label May 22, 2024
ErvinSabic added a commit to ErvinSabic/ember-headless-form that referenced this issue Jan 13, 2025
@ErvinSabic
Copy link
Contributor

@simonihmig I went ahead and implemented this. If you could check out the PR I created when you get the chance.

simonihmig added a commit that referenced this issue Jan 17, 2025
* added yielding of current form data. #379 along with tests and updated test app

* updating documentation for usage

* using 'data' instead of 'effectiveData' to be consistent with field data yield'

* resolved typing error. however getting ELIFECYCLE error on lint

* linting passed.

* changed yielded data to not be optional

* changeset

---------

Co-authored-by: Simon Ihmig <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants