Merge branch '14248_assigning_properties_to_projects_during_create'
[arvados-workbench2.git] / src / components / autocomplete / autocomplete.tsx
index b250c7b8ecd43bfc89171e4a9de373bf0cd22ffa..4b19b77115b388e3613c6004013ef6501aded2b6 100644 (file)
@@ -152,6 +152,16 @@ export class Autocomplete<Value, Suggestion> extends React.Component<Autocomplet
 
     renderChips() {
         const { items, onDelete } = this.props;
+
+        /**
+         * If input startAdornment prop is not undefined, input's label will stay above the input.
+         * If there is not items, we want the label to go back to placeholder position.
+         * That why we return without a value instead of returning a result of a _map_ which is an empty array.
+         */
+        if (items.length === 0) {
+            return;
+        }
+
         return items.map(
             (item, index) =>
                 <Chip