From 71537c437ad2a91360ed647a4f393049224c9302 Mon Sep 17 00:00:00 2001 From: raphaeldas Date: Wed, 2 Jul 2025 12:26:57 +0200 Subject: [PATCH 1/3] fix defaultValue set at the wrong place the defaultValue property must be placed in the item object and can be type string or boolean --- docusaurus/docs/dev-docs/custom-fields.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docusaurus/docs/dev-docs/custom-fields.md b/docusaurus/docs/dev-docs/custom-fields.md index 190a7269cd..5e01fda768 100644 --- a/docusaurus/docs/dev-docs/custom-fields.md +++ b/docusaurus/docs/dev-docs/custom-fields.md @@ -281,6 +281,7 @@ Each object in the `items` array can contain the following parameters: | `description` | Description of the input to use in the Content-type Builder | [`IntlObject`](https://formatjs.io/docs/react-intl/) | | `intlLabel` | Translation for the label of the input | [`IntlObject`](https://formatjs.io/docs/react-intl/) | | `type` | Type of the input (e.g., `select`, `checkbox`) | `String` | +| `defaultValue` | Set the defaultValue for the item | `String` | `boolean` |
Example: Declaring options for an example "color" custom field: @@ -322,12 +323,11 @@ export default { }, name: "options.format", type: "select", - value: "hex", // option selected by default + defaultValue: "hex", // option selected by default options: [ // List all available "Color format" options { key: "hex", - defaultValue: "hex", value: "hex", metadatas: { intlLabel: { From a1f65ceda663427272e79e211c6df96e5d2b8c67 Mon Sep 17 00:00:00 2001 From: raphaeldas Date: Wed, 2 Jul 2025 12:29:24 +0200 Subject: [PATCH 2/3] update description for item parameter defaultValue --- docusaurus/docs/dev-docs/custom-fields.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docusaurus/docs/dev-docs/custom-fields.md b/docusaurus/docs/dev-docs/custom-fields.md index 5e01fda768..4b5c2ca51b 100644 --- a/docusaurus/docs/dev-docs/custom-fields.md +++ b/docusaurus/docs/dev-docs/custom-fields.md @@ -281,7 +281,7 @@ Each object in the `items` array can contain the following parameters: | `description` | Description of the input to use in the Content-type Builder | [`IntlObject`](https://formatjs.io/docs/react-intl/) | | `intlLabel` | Translation for the label of the input | [`IntlObject`](https://formatjs.io/docs/react-intl/) | | `type` | Type of the input (e.g., `select`, `checkbox`) | `String` | -| `defaultValue` | Set the defaultValue for the item | `String` | `boolean` | +| `defaultValue` | Set the default value for the item | `String` | `boolean` |
Example: Declaring options for an example "color" custom field: From d698be87580d6fa7bb87be61bd8106a8b6f6c5d8 Mon Sep 17 00:00:00 2001 From: raphaeldas Date: Wed, 2 Jul 2025 12:32:57 +0200 Subject: [PATCH 3/3] remove whitespace --- docusaurus/docs/dev-docs/custom-fields.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docusaurus/docs/dev-docs/custom-fields.md b/docusaurus/docs/dev-docs/custom-fields.md index 4b5c2ca51b..a173c2efb8 100644 --- a/docusaurus/docs/dev-docs/custom-fields.md +++ b/docusaurus/docs/dev-docs/custom-fields.md @@ -281,7 +281,7 @@ Each object in the `items` array can contain the following parameters: | `description` | Description of the input to use in the Content-type Builder | [`IntlObject`](https://formatjs.io/docs/react-intl/) | | `intlLabel` | Translation for the label of the input | [`IntlObject`](https://formatjs.io/docs/react-intl/) | | `type` | Type of the input (e.g., `select`, `checkbox`) | `String` | -| `defaultValue` | Set the default value for the item | `String` | `boolean` | +| `defaultValue` | Set the default value for the item | `String` | `boolean` |
Example: Declaring options for an example "color" custom field: