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

[AutoComplete] onNewRequest doesn't fire within iOS devices #5715

Merged
merged 1 commit into from
Dec 4, 2016
Merged
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
10 changes: 8 additions & 2 deletions src/AutoComplete/AutoComplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ class AutoComplete extends Component {
*
* @param {string} searchText The auto-complete's `searchText` value.
* @param {array} dataSource The auto-complete's `dataSource` array.
* @param {object} params Additional information linked the update.
*/
onUpdateInput: PropTypes.func,
/**
Expand Down Expand Up @@ -231,6 +232,7 @@ class AutoComplete extends Component {

componentWillUnmount() {
clearTimeout(this.timerTouchTapCloseId);
clearTimeout(this.timerBlurClose);
}

close() {
Expand Down Expand Up @@ -335,13 +337,17 @@ class AutoComplete extends Component {
open: true,
anchorEl: ReactDOM.findDOMNode(this.refs.searchTextField),
}, () => {
this.props.onUpdateInput(searchText, this.props.dataSource);
this.props.onUpdateInput(searchText, this.props.dataSource, {
source: 'change',
});
});
};

handleBlur = (event) => {
if (this.state.focusTextField && this.timerTouchTapCloseId === null) {
this.close();
this.timerBlurClose = setTimeout(() => {
this.close();
}, 0);
}

if (this.props.onBlur) {
Expand Down