Commit ac0512d
committed
fix(web): emit initial form values on mount to prevent saving empty config
DynamicFormComponent uses form.watch(callback) to notify parent of form
values, but react-hook-form's watch callback only fires on subsequent
changes, not on mount. This causes PluginForm's currentFormValues to
remain as {} if the user saves without modifying any field, overwriting
the existing plugin config with an empty object in the database.1 parent 20f0e99 commit ac0512d
File tree
1 file changed
+13
-1
lines changed- web/src/app/home/components/dynamic-form
1 file changed
+13
-1
lines changedLines changed: 13 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
146 | 159 | | |
147 | | - | |
148 | 160 | | |
149 | 161 | | |
150 | 162 | | |
| |||
0 commit comments