Add autofocus prop to people select
authorMichal Klobukowski <michal.klobukowski@contractors.roche.com>
Sun, 16 Dec 2018 21:27:58 +0000 (22:27 +0100)
committerMichal Klobukowski <michal.klobukowski@contractors.roche.com>
Sun, 16 Dec 2018 21:27:58 +0000 (22:27 +0100)
Feature #14505

Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski@contractors.roche.com>

src/views-components/sharing-dialog/people-select.tsx

index bee59c22530ca602be754f8e7fb0e6542b89ff95..f62e6f55ac0d5a27986c8d719051174d9cc88843 100644 (file)
@@ -17,10 +17,12 @@ export interface Person {
     email: string;
     uuid: string;
 }
+
 export interface PeopleSelectProps {
 
     items: Person[];
     label?: string;
+    autofocus?: boolean;
 
     onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
     onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;
@@ -53,6 +55,7 @@ export const PeopleSelect = connect()(
                     value={this.state.value}
                     items={this.props.items}
                     suggestions={this.state.suggestions}
+                    autofocus={this.props.autofocus}
                     onChange={this.handleChange}
                     onCreate={this.handleCreate}
                     onSelect={this.handleSelect}