Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/dataviews/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Documentation

- Document that a custom `sort` receives the field values returned by `getValue`, not the items ([#83483](https://github.com/WordPress/gutenberg/pull/83483)).

## 19.1.0 (2026-09-23)

### New Features
Expand Down
4 changes: 2 additions & 2 deletions packages/dataviews/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1720,8 +1720,8 @@ When the field declares a type, it gets a default sort function:

The default sorting can be overridden by providing a custom sort function. It takes the following arguments:

- `a`: the first item to compare
- `b`: the second item to compare
- `a`: the value of the field (as returned by `getValue`) for the first item to compare
- `b`: the value of the field (as returned by `getValue`) for the second item to compare
- `direction`: either `asc` (ascending) or `desc` (descending)

It should return a number where:
Expand Down
2 changes: 1 addition & 1 deletion packages/dataviews/src/types/field-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ export type NormalizedField< Item > = Omit<
* Callback used to sort the field. Defaults to the sorter
* of the field's type.
*
* Receives the field valuesof the two items being compared.
* Receives the field values of the two items being compared.
*/
sort: ( a: any, b: any, direction: SortDirection ) => number;

Expand Down
Loading