-
Notifications
You must be signed in to change notification settings - Fork 78
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
Update form when atom is replaced? #107
Comments
In your example, you're creating the |
The question is more this. I want to populate a form with some data I fetch asynchronously. How can I make sure that, given I start with no data and render an empty form, then load data to populate it, how to I make sure it's populated with that latter data? |
Currently, the data has to be available at the time |
Actually, it appears to work properly for textbox, and I have a fix for :list. It looks like radio groups and selection groups have this problem still. It looks like a minor fix to handle, I may give it a try for some other fields... |
Yeah that looks promising, if you think you can get it to work I'd love a pr for this. |
Tested fix for single-select for selection groups. See mods at https://github.com/khdegraaf/reagent-forms. Multi-select may be fixed too, but haven't tested it. Did test and verify checkbox, textbox (and presumably variations), and datepicker all work in my project. I haven't tested the others. I'll do a push request at some point. |
Fantastic, thanks for spearheading this. |
I believe I'm hitting similar behavior to a few of the other issues, but it's quite unclear how to resolve.
I have a form as so:
The issue is, when some-form is re-rendered (because a level above it is reacting to @\foo), the form does not seem to re-render. (If I throw in a some text field reacting to @\doc here, the text field will update)
What is the proper way to handle this? It's not quite that I am updating the atom externally, it's that I'm asynchronously loading the data that goes into the atom. I want to replace it entirely.
The text was updated successfully, but these errors were encountered: