Skip to content

Commit 9071a2a

Browse files
Field API: document missing props (WordPress#73515)
Co-authored-by: oandregal <oandregal@git.wordpress.org> Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org>
1 parent 2dcc5ac commit 9071a2a

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

packages/dataviews/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
- Documentation: improve Edit component. [#73202](https://github.com/WordPress/gutenberg/pull/73202)
1616
- Documentation: surface better the `type` property in the documentation. [#73349](https://github.com/WordPress/gutenberg/pull/73349)
1717
- Documentation: improve DataView's `layout` prop. [#73470](https://github.com/WordPress/gutenberg/pull/73470)
18+
- Documentation: document `readOnly`, `description`, and `placeholder` properties. [#73515](https://github.com/WordPress/gutenberg/pull/73515)
1819
- DataForm Panel Layout: Focus the first input element when the panel opens. [#72322](https://github.com/WordPress/gutenberg/pull/72322)
1920
- DataForm: Pattern validation is now supported on all fields that browsers support it in. [#73156](https://github.com/WordPress/gutenberg/pull/73156)
2021

packages/dataviews/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,6 +1198,20 @@ Example:
11981198
}
11991199
```
12001200
1201+
### `description`
1202+
1203+
A string describing the field's purpose or usage. Used to provide context in Edit mode, etc.
1204+
1205+
- Type: `string`.
1206+
- Optional.
1207+
1208+
### `placeholder`
1209+
1210+
A string used as a placeholder in Edit mode, etc.
1211+
1212+
- Type: `string`.
1213+
- Optional.
1214+
12011215
### `getValue` and `setValue`
12021216
12031217
These functions control how field values are read from and written to your data structure.
@@ -1442,6 +1456,13 @@ Finally, the field author can always provide its own custom `Edit` control. It r
14421456
}
14431457
```
14441458
1459+
### `readOnly`
1460+
1461+
Boolean indicating that the field is not editable. Fields that are not editable use the `render` function to display their value in Edit contexts.
1462+
1463+
- Type: `boolean`.
1464+
- Optional.
1465+
- Defaults to `false`.
14451466
14461467
### `sort`
14471468

0 commit comments

Comments
 (0)