15768: merge cleanup Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox@curii.com>
[arvados.git] / src / views-components / sharing-dialog / participant-select.tsx
index 02cdeaf2c28e814a3a1d72d24d8cfadfe143eee3..058d7234e47124ae32841462cfccc0bc9cf63523 100644 (file)
@@ -74,7 +74,7 @@ export const ParticipantSelect = connect()(
         };
 
         render() {
-            const { label = 'Share' } = this.props;
+            const { label = 'Add people and groups' } = this.props;
 
             return (
                 <Autocomplete
@@ -88,14 +88,21 @@ export const ParticipantSelect = connect()(
                     onSelect={this.handleSelect}
                     onDelete={this.props.onDelete && !this.props.disabled ? this.handleDelete : undefined}
                     onFocus={this.props.onFocus}
-                    onBlur={this.props.onBlur}
+                    onBlur={this.onBlur}
                     renderChipValue={this.renderChipValue}
                     renderChipTooltip={this.renderChipTooltip}
                     renderSuggestion={this.renderSuggestion}
-                    disabled={this.props.disabled}/>
+                    disabled={this.props.disabled} />
             );
         }
 
+        onBlur = (e) => {
+            if (this.props.onBlur) {
+                this.props.onBlur(e);
+            }
+            setTimeout(() => this.setState({ value: '', suggestions: [] }), 200);
+        }
+
         renderChipValue(chipValue: Participant) {
             const { name, uuid } = chipValue;
             return name || uuid;