diff options
author | Joram Wilander <jwawilander@gmail.com> | 2016-01-25 07:27:15 -0500 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2016-01-25 07:27:15 -0500 |
commit | 4db80803aa5521ff74c726ec3c223bbef9e2eb46 (patch) | |
tree | 1ef0df4903eecc1179064f4be73f618ecc017b35 /web/react/components/suggestion/at_mention_provider.jsx | |
parent | a401b9f942e33d966d09045468bfbd206a963601 (diff) | |
parent | 43c19981cf67c6b1b3c4f99a1a95fce82d743584 (diff) | |
download | chat-4db80803aa5521ff74c726ec3c223bbef9e2eb46.tar.gz chat-4db80803aa5521ff74c726ec3c223bbef9e2eb46.tar.bz2 chat-4db80803aa5521ff74c726ec3c223bbef9e2eb46.zip |
Merge pull request #1963 from hmhealey/plt1670
PLT-1670 Added a limit to the number of suggestions when autocompleting at mentions
Diffstat (limited to 'web/react/components/suggestion/at_mention_provider.jsx')
-rw-r--r-- | web/react/components/suggestion/at_mention_provider.jsx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/web/react/components/suggestion/at_mention_provider.jsx b/web/react/components/suggestion/at_mention_provider.jsx index 8c2893448..e502c981d 100644 --- a/web/react/components/suggestion/at_mention_provider.jsx +++ b/web/react/components/suggestion/at_mention_provider.jsx @@ -5,6 +5,8 @@ import SuggestionStore from '../../stores/suggestion_store.jsx'; import UserStore from '../../stores/user_store.jsx'; import * as Utils from '../../utils/utils.jsx'; +const MaxUserSuggestions = 40; + class AtMentionSuggestion extends React.Component { render() { const {item, isSelection, onClick} = this.props; @@ -78,6 +80,10 @@ export default class AtMentionProvider { if (user.username.startsWith(usernamePrefix)) { filtered.push(user); } + + if (filtered.length >= MaxUserSuggestions) { + break; + } } // add dummy users to represent the @all and @channel special mentions |