From aea97b29e3bd8de656b49408bba0ae0273c6ef05 Mon Sep 17 00:00:00 2001 From: Robert Karlsson Date: Mon, 11 Jun 2018 16:33:42 +0200 Subject: [PATCH] Only use label_singular when one item is rendered in the listControl Fixes #1397. Check the size of the item list and set the listlabel based on that. If no label_singular is set, fall back to the normal label --- src/components/EditorWidgets/List/ListControl.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/EditorWidgets/List/ListControl.js b/src/components/EditorWidgets/List/ListControl.js index 0d7d30a346b6..49f262d94c66 100644 --- a/src/components/EditorWidgets/List/ListControl.js +++ b/src/components/EditorWidgets/List/ListControl.js @@ -262,14 +262,15 @@ export default class ListControl extends Component { const { value, forID, field, classNameWrapper } = this.props; const { itemsCollapsed } = this.state; const items = value || List(); - const label = field.get('label_singular') || field.get('label'); + const label = field.get('label'); + const labelSingular = field.get('label_singular') || field.get('label'); return (
val === true)} itemsCount={items.size}