Skip to content

Handle primitive labeling in angular-material MasterListComponent #1779

@JBBianchi

Description

@JBBianchi

Is your feature request related to a problem? Please describe.

When using a ListWithDetail on an array of strings, the label stays undefined even if the options.labelRef is set to #.

{ "type": "ListWithDetail", "scope": "#/properties/an-array-of-strings", "options": { "labelRef": "#" } }

Describe the solution you'd like

I'd like the label to be the value of the item. This could be achieved by modifiying the following in master.ts

const dataIsPrimitive = d && typeof d !== 'object'; const masterItem = { label: get(d, labelRefInstancePath, dataIsPrimitive ? d : ''), data: d, path: `${path}.${index}`, schema, uischema: detailUISchema };

Describe alternatives you've considered

Using "my own" version of MasterListComponent.

Framework

Angular

RendererSet

Material

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions