Commit 734403b
committed
fix(widgetsFor): return widgets for variable type lists
When using a Variable Type list widget and a custom preview component,
the `widgetsFor` helper would only return a `data` list with each of the
items in the list, not a `widgets` list, e.g.
{"data" =>
{"markdown" => "# Title"}
{"type" => "block_body"}
}
{"widgets" => undefined} 🚫
The `widgets` list should also be supplied, particularly for nested
Markdown widgets, so a fully formatted preview can be rendered:
{"data" =>
{"markdown" => "# Title"}
{"type" => "block_body"}
}
{"widgets" =>
{"markdown" => Object} ✅
}
This extends support in `widgetsFor` to detect variable type list
widgets and correctly construct the `widgets` return value.
As reported at #2307 (comment)1 parent 51eb7e8 commit 734403b
File tree
1 file changed
+19
-0
lines changed- packages/decap-cms-core/src/components/Editor/EditorPreviewPane
1 file changed
+19
-0
lines changedLines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| 170 | + | |
170 | 171 | | |
171 | 172 | | |
172 | 173 | | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
173 | 192 | | |
174 | 193 | | |
175 | 194 | | |
| |||
0 commit comments