fix: fix Select field preview (#4507)

* fix: fix Select field preview

Closes #4084

* fix: fix field preview utils tests
This commit is contained in:
Thaïs
2024-03-25 16:37:41 +01:00
committed by GitHub
parent 2ae59a801f
commit 61e5d5bcb9
8 changed files with 33 additions and 17 deletions
@@ -26,7 +26,9 @@ export const getFieldDefaultPreviewValue = ({
fieldMetadataItem.type === FieldMetadataType.Select &&
isDefined(selectOptions)
) {
return selectOptions.find(({ isDefault }) => isDefault) || selectOptions[0];
const defaultSelectOption =
selectOptions.find(({ isDefault }) => isDefault) || selectOptions[0];
return defaultSelectOption.value;
}
// Relation field