Skip to content

Commit ffa907f

Browse files
authored
Fix item parameter for custom field options (#2572)
* fix defaultValue set at the wrong place the defaultValue property must be placed in the item object and can be type string or boolean * update description for item parameter defaultValue * remove whitespace
1 parent c5b0762 commit ffa907f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docusaurus/docs/dev-docs/custom-fields.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ Each object in the `items` array can contain the following parameters:
281281
| `description` | Description of the input to use in the Content-type Builder | [`IntlObject`](https://formatjs.io/docs/react-intl/) |
282282
| `intlLabel` | Translation for the label of the input | [`IntlObject`](https://formatjs.io/docs/react-intl/) |
283283
| `type` | Type of the input (e.g., `select`, `checkbox`) | `String` |
284+
| `defaultValue` | Set the default value for the item | `String` | `boolean` |
284285

285286
<details>
286287
<summary>Example: Declaring options for an example "color" custom field:</summary>
@@ -322,12 +323,11 @@ export default {
322323
},
323324
name: "options.format",
324325
type: "select",
325-
value: "hex", // option selected by default
326+
defaultValue: "hex", // option selected by default
326327
options: [
327328
// List all available "Color format" options
328329
{
329330
key: "hex",
330-
defaultValue: "hex",
331331
value: "hex",
332332
metadatas: {
333333
intlLabel: {

0 commit comments

Comments
 (0)