Merge branch 'master' into 14603-add-controlled-vocabulary-to-advanced-search
[arvados-workbench2.git] / src / components / autocomplete / autocomplete.tsx
index b250c7b8ecd43bfc89171e4a9de373bf0cd22ffa..52918c34ab47ee68c009cff6bd5bfdb42b80598b 100644 (file)
@@ -152,6 +152,15 @@ 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.
+         */
+        if (items.length === 0) {
+            return;
+        }
+
         return items.map(
             (item, index) =>
                 <Chip