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

field.set(obj) doesn't update form.touched and form.changed #337

Closed
Vargentum opened this issue Nov 1, 2017 · 5 comments
Closed

field.set(obj) doesn't update form.touched and form.changed #337

Vargentum opened this issue Nov 1, 2017 · 5 comments

Comments

@Vargentum
Copy link

I have a field with an empty object as initial value. I'm using field.set to dynamically add some new keys. It works good, but form properties (touched, changed) don't reflect these changes.

Also, could you provide some examples how to deal with Array and Object values? Current docs don't clarify this enough.

@foxhound87
Copy link
Owner

foxhound87 commented Nov 4, 2017

Right now the set() method doesn't change other fields props.

I need to think more about how to handle this, as the set() method doesn't handle specific behavior for each props right now.

About dealing with complex fields structure, did you take a look to the demo repo?

@andfk
Copy link

andfk commented Nov 27, 2017

Same issue for me. form.set('changed', true) as simple temporal fix is not allowed neither so for now there is not a way to change form state manually? (at least until we find a solution).

@danielkcz
Copy link

It feels rather intuitive that you need to call form.select(field).onUpdate(value) to actually update a changed flag. Took me quite some time to figure that out from source code :(

@github-actions
Copy link

github-actions bot commented Apr 2, 2023

🎉 This issue has been resolved in version 5.8.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@foxhound87
Copy link
Owner

From version 5.8 field set() will trigger onChange hook on ‘changed’ field prop increment.

‘touched’ prop is changed only if the user interact with inputs

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

No branches or pull requests

4 participants