ArrayFieldItemTemplateProps.displayLabel says whether a label sits above the item's control
Detect
displayLabelread in a customArrayFieldItemTemplatein your code.- On the rendered page, an array item's buttons sit at a different height than before.
Change
ArrayFieldItemTemplateProps.displayLabel now comes from the plan the item's SchemaField builds, where it was getDisplayLabel() of the item's schema and its own uiSchema. It says whether a label sits above the item's control: a label its template draws, which is the displayLabel the item's own FieldTemplate is handed (see A custom FieldTemplate, ObjectFieldTemplate or ArrayFieldTemplate draws what the plan hands it), or one its field or widget draws itself where its declaration places it labelPlacement: 'above', as @rjsf/fluentui-rc, @rjsf/chakra-ui and @rjsf/mantine declare their widgets' labels. So the item's buttons are placed by the label above its control.
It is now false for:
- an item with no label text;
- a
nullitem; - a hidden item;
- a boolean under
ui:widget: 'checkbox'; - a custom field drawing its own label, whichever of
ui:fieldor a$idnames it, unless its declaration places that label above; - in
@rjsf/mui, whose text inputs and selects draw their label inside the input's outline, those inputs and selects.
It is now true for:
- a custom field declared
{ label: 'template' }; - a boolean whose titled
oneOfconstants render a select; - an object
anyOf/oneOf, whose selector its template labels; - an item the fallback UI (
useFallbackUiForUnsupportedType) renders with a choice of types, whose type selector comes first and is labelled for the type whatever the item's title, unlessui:labelisfalseor the item is hidden, which hides the selector with it.
Keep reading displayLabel to align the item's buttons with its control, and don't recompute it from the item's schema.
Verify
Each array item's buttons line up with its control, beside a label above it where there is one.
Also read: