Skip to content

DataViews Field API: async elements #70834

@oandregal

Description

@oandregal

What?

The Field API developed with DataViews comes with an elements property, which enables the field to declare valid values for it. It's also used to generate a filter for the field. The elements property is static and there's no way for the fields to fetch the data they need.

Why?

The issue can be experienced by creating a few hundred users in your site. Then, go to a page that has the "author" filter (e.g., Pages screen in the site editor). Note how the filter doesn't display the list of users until all of them are loaded. While they load, it defaults to the Edit component of the field. In this case, a number input:

Screen.Recording.2025-07-22.at.10.45.04.mov

How?

  • Field API: support async loading elements #72254
  • Pagination: load the control with a subset of data (e.g., 100), and load the rest as the user scroll.
  • Search: re-trigger element fetching when user typed anything in the search filter control (other Edit components may have similar interactions).

Metadata

Metadata

Assignees

Labels

[Feature] DataViewsWork surrounding upgrading and evolving views in the site editor and beyond[Type] EnhancementA suggestion for improvement.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions