summaryrefslogtreecommitdiffstats
path: root/webapp/components/more_direct_channels
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-07-27 07:44:47 -0400
committerGitHub <noreply@github.com>2017-07-27 07:44:47 -0400
commitb428d565caa17550dbf3e938eeb927979568114a (patch)
treeef1b4ee4020bc8ac4261a2605a351fcde8c830c9 /webapp/components/more_direct_channels
parent3043b5d52a0192f4e9f1574de42ca9c23a725093 (diff)
downloadchat-b428d565caa17550dbf3e938eeb927979568114a.tar.gz
chat-b428d565caa17550dbf3e938eeb927979568114a.tar.bz2
chat-b428d565caa17550dbf3e938eeb927979568114a.zip
Go to page zero when searching direct channels (#6977)
Diffstat (limited to 'webapp/components/more_direct_channels')
-rw-r--r--webapp/components/more_direct_channels/more_direct_channels.jsx10
1 files changed, 9 insertions, 1 deletions
diff --git a/webapp/components/more_direct_channels/more_direct_channels.jsx b/webapp/components/more_direct_channels/more_direct_channels.jsx
index 46c04c46e..ab338f68e 100644
--- a/webapp/components/more_direct_channels/more_direct_channels.jsx
+++ b/webapp/components/more_direct_channels/more_direct_channels.jsx
@@ -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}