Commit 9be2693
fix(widgetsFor): return widgets for variable type lists (#7296)
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)
Co-authored-by: Anze Demsar <anze.demsar@p-m.si>1 parent 989c2dd commit 9be2693
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 | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
| 172 | + | |
172 | 173 | | |
173 | 174 | | |
174 | 175 | | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
175 | 194 | | |
176 | 195 | | |
177 | 196 | | |
| |||
0 commit comments