Skip to content

Commit

Permalink
fix label determination
Browse files Browse the repository at this point in the history
  • Loading branch information
sdirix committed Apr 18, 2024
1 parent 8c0d2a4 commit 4284d6e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/core/src/util/label.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,18 @@ export const computeChildLabel = (
rootSchema: JsonSchema,
translateFct: Translator,
uiSchema: UISchemaElement
): any => {
): string => {
const childData = Resolve.data(data, childPath);

if (!childLabelProp) {
childLabelProp = getFirstPrimitiveProp(schema);
}

// return early in case there is no prop we can query
if (!childLabelProp) {
return '';
}

const currentValue = get(childData, childLabelProp, '');

// check whether the value is part of a oneOf or enum and needs to be translated
Expand Down

0 comments on commit 4284d6e

Please sign in to comment.