Fix: uncontrolled input in dashboard - #895
Conversation
| OPENAI_API_KEY: '', | ||
| ANTHROPIC_API_KEY: '', | ||
| GOOGLE_API_KEY: '', | ||
| }; |
There was a problem hiding this comment.
This looks like the third place we are duplicating configuration setting names. Is there any way to populate this dynmamically?
There was a problem hiding this comment.
we populate this dynamically using config file but sometimes we might get undefined values which might be the reason for warning. So, I added these default values
| <form onSubmit={form.onSubmit(saveSettings(form))}> | ||
| <Grid> | ||
| <Grid.Col span={6}> | ||
| <Checkbox label="Record window data" {...form.getInputProps('RECORD_WINDOW_DATA')} checked={form.values.RECORD_WINDOW_DATA} /> |
There was a problem hiding this comment.
Won't this prevent the checkboxes from being checked appropriately depending on the configuration values?
There was a problem hiding this comment.
...form.getInputProps('RECORD_WINDOW_DATA') this alone should've marked this checked but yes now that I tested it again without checked= property it is not being marked appropriately.
|
Closing as part of the architecture transition. The legacy codebase has been moved to If this change is still needed, please:
See PR #960 for details on the new meta-package architecture. |
What kind of change does this PR introduce?
a Bugfix for #889
Summary
checkedproperty: This avoids conflicting control by lettinggetInputPropsfully manage the checkbox state.defaultSettingswhich provides default values for all fields, preventing uncontrolled-to-controlled issues.Checklist
How can your code be run and tested?