Go to page zero when searching direct channels (#6977)

Этот коммит содержится в:
Joram Wilander
2017-07-27 07:44:47 -04:00
коммит произвёл GitHub
родитель 3043b5d52a
Коммит b428d565ca
2 изменённых файлов: 20 добавлений и 16 удалений

Просмотреть файл

@@ -185,11 +185,18 @@ export default class MoreDirectChannels extends React.Component {
}
}
resetPaging = () => {
if (this.refs.multiselect) {
this.refs.multiselect.resetPaging();
}
}
search(term) {
clearTimeout(this.searchTimeoutId);
this.term = term;
if (term === '') {
this.resetPaging();
this.onChange();
return;
}
@@ -203,7 +210,7 @@ export default class MoreDirectChannels extends React.Component {
this.searchTimeoutId = setTimeout(
() => {
searchUsers(term, teamId);
searchUsers(term, teamId, {}, this.resetPaging);
},
Constants.SEARCH_TIMEOUT_MILLISECONDS
);
@@ -315,6 +322,7 @@ export default class MoreDirectChannels extends React.Component {
<Modal.Body>
<MultiSelect
key='moreDirectChannelsList'
ref='multiselect'
options={users}
optionRenderer={this.renderOption}
values={this.state.values}