From 590020403cdafb02be61767cf06524b995c1d9c5 Mon Sep 17 00:00:00 2001 From: Flaminia Cavallo Date: Tue, 17 Dec 2024 10:23:53 +0100 Subject: [PATCH] fix: only sort if persisted unless it is display name --- src/lib/sectionList/useSectionListSortOrder.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/sectionList/useSectionListSortOrder.ts b/src/lib/sectionList/useSectionListSortOrder.ts index a79bd932..a428e3db 100644 --- a/src/lib/sectionList/useSectionListSortOrder.ts +++ b/src/lib/sectionList/useSectionListSortOrder.ts @@ -43,7 +43,10 @@ export const isValidSortPathForSchema = (schema: Schema, path: string) => { const schemaProperty = getSchemaPropertyForPath(schema, path) // sorting for metadata-API only works on simple and persisted properties - if (schemaProperty && schemaProperty.simple) { + if (schemaProperty && schemaProperty.simple && schemaProperty.persisted) { + return true + } + if (schemaProperty?.name === 'displayName') { return true } return false