summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2015-11-06 12:39:56 -0500
committerJoram Wilander <jwawilander@gmail.com>2015-11-06 12:39:56 -0500
commited2537c4b54dfa7b5feeabf6a12124a540011001 (patch)
tree7333739f82ac95fb03ba3feb31c70eb6c5b46a74 /web
parent8d7f1c1705cb904d1cf5ad99f8fdafd7530517f0 (diff)
parent6ba996a9e25cc2df05fef1fef2e2f6dd8903625c (diff)
downloadchat-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.jsx11
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') {