Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass inputRef to <Suggest> & <MultiSelect> #2216

Merged
merged 1 commit into from
Mar 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion packages/select/src/components/select/multiSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,12 @@ export class MultiSelect<T> extends React.PureComponent<IMultiSelectProps<T>, IM
private input: HTMLInputElement;
private queryList: QueryList<T>;
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<T>) => (this.queryList = ref),
};

Expand Down
7 changes: 6 additions & 1 deletion packages/select/src/components/select/suggest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,12 @@ export class Suggest<T> extends React.PureComponent<ISuggestProps<T>, ISuggestSt
private TypedQueryList = QueryList.ofType<T>();
private queryList: QueryList<T>;
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<T>) => (this.queryList = ref),
};

Expand Down