diff --git a/src/app/form/widgets/ArrayWidget.js b/src/app/form/widgets/ArrayWidget.js index 92d934c6..5f9d02cd 100644 --- a/src/app/form/widgets/ArrayWidget.js +++ b/src/app/form/widgets/ArrayWidget.js @@ -15,7 +15,8 @@ const renderArrayFields = ( fieldName, remove, context, - swap + swap, + required, ) => { const prefix = fieldName + "."; @@ -26,16 +27,22 @@ const renderArrayFields = ( isSummary = true; } schema.isSummary = isSummary; + + // We always show the button for removing the field unless + // it's the first field of a required array field (ie. we don't allow its + // removal). + const show_close_button = (required && idx > 0) || !required; + return (