diff options
author | Joram Wilander <jwawilander@gmail.com> | 2015-11-06 12:39:56 -0500 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2015-11-06 12:39:56 -0500 |
commit | ed2537c4b54dfa7b5feeabf6a12124a540011001 (patch) | |
tree | 7333739f82ac95fb03ba3feb31c70eb6c5b46a74 /web | |
parent | 8d7f1c1705cb904d1cf5ad99f8fdafd7530517f0 (diff) | |
parent | 6ba996a9e25cc2df05fef1fef2e2f6dd8903625c (diff) | |
download | chat-ed2537c4b54dfa7b5feeabf6a12124a540011001.tar.gz chat-ed2537c4b54dfa7b5feeabf6a12124a540011001.tar.bz2 chat-ed2537c4b54dfa7b5feeabf6a12124a540011001.zip |
Merge pull request #1341 from hmhealey/plt911
PLT-911 Fixed navigating search autocomplete with the keyboard
Diffstat (limited to 'web')
-rw-r--r-- | web/react/components/search_autocomplete.jsx | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/web/react/components/search_autocomplete.jsx b/web/react/components/search_autocomplete.jsx index 3ff33fe57..d245c6bac 100644 --- a/web/react/components/search_autocomplete.jsx +++ b/web/react/components/search_autocomplete.jsx @@ -189,7 +189,16 @@ export default class SearchAutocomplete extends React.Component { channels = channels.filter((channel) => channel.type !== 'D'); } - channels.sort((a, b) => a.name.localeCompare(b.name)); + channels.sort((a, b) => { + // put public channels first and then sort alphabebetically + if (a.type === b.type) { + return a.name.localeCompare(b.name); + } else if (a.type === Constants.OPEN_CHANNEL) { + return -1; + } + + return 1; + }); suggestions = channels; } else if (mode === 'users') { |