From 745c33a340c5aef838f546a47c06ee450fa0c9cb Mon Sep 17 00:00:00 2001 From: Aleksey Mironenko Date: Thu, 8 Mar 2018 11:33:35 +0200 Subject: [PATCH] Pass inputRef to & --- packages/select/src/components/select/multiSelect.tsx | 7 ++++++- packages/select/src/components/select/suggest.tsx | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/select/src/components/select/multiSelect.tsx b/packages/select/src/components/select/multiSelect.tsx index bd010a58f1..8dacf557da 100644 --- a/packages/select/src/components/select/multiSelect.tsx +++ b/packages/select/src/components/select/multiSelect.tsx @@ -78,7 +78,12 @@ export class MultiSelect extends React.PureComponent, IM private input: HTMLInputElement; private queryList: QueryList; private refHandlers = { - input: (ref: HTMLInputElement) => (this.input = ref), + input: (ref: HTMLInputElement) => { + this.input = ref; + + const { tagInputProps = {} } = this.props; + Utils.safeInvoke(tagInputProps.inputRef, ref); + }, queryList: (ref: QueryList) => (this.queryList = ref), }; diff --git a/packages/select/src/components/select/suggest.tsx b/packages/select/src/components/select/suggest.tsx index 54b455b148..ce3e7fd523 100644 --- a/packages/select/src/components/select/suggest.tsx +++ b/packages/select/src/components/select/suggest.tsx @@ -88,7 +88,12 @@ export class Suggest extends React.PureComponent, ISuggestSt private TypedQueryList = QueryList.ofType(); private queryList: QueryList; private refHandlers = { - input: (ref: HTMLInputElement) => (this.input = ref), + input: (ref: HTMLInputElement) => { + this.input = ref; + + const { inputProps = {} } = this.props; + Utils.safeInvoke(inputProps.inputRef, ref); + }, queryList: (ref: QueryList) => (this.queryList = ref), };