diff --git a/packages/dataviews/src/components/dataviews-view-config/index.tsx b/packages/dataviews/src/components/dataviews-view-config/index.tsx index 3e4fc97308aa3..bd9bc1b19803e 100644 --- a/packages/dataviews/src/components/dataviews-view-config/index.tsx +++ b/packages/dataviews/src/components/dataviews-view-config/index.tsx @@ -139,6 +139,14 @@ function SortFieldControl() { function SortDirectionControl() { const { view, fields, onChangeView } = useContext( DataViewsContext ); + + const sortableFields = fields.filter( + ( field ) => field.enableSorting !== false + ); + if ( sortableFields.length === 0 ) { + return null; + } + let value = view.sort?.direction; if ( ! value && view.sort?.field ) { value = 'desc';