diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2017-05-23 10:17:06 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-23 10:17:06 -0400 |
commit | 69f3f2fdce4ae21a037ca61d753279efcc70f0ec (patch) | |
tree | dea69385c8bd3190d7bc2f72563b929ecdf527f2 /webapp/components/suggestion/suggestion_list.jsx | |
parent | 52f73c30cafd6afaa11361b05972e25ebc223a81 (diff) | |
download | chat-69f3f2fdce4ae21a037ca61d753279efcc70f0ec.tar.gz chat-69f3f2fdce4ae21a037ca61d753279efcc70f0ec.tar.bz2 chat-69f3f2fdce4ae21a037ca61d753279efcc70f0ec.zip |
PLT-6282 Make post list stay visible when post textbox height changes (#6323)
* PLT-6282 Changed post drafts to use an action when being stored
* PLT-6282 Triggered post list to update scroll position when post draft changes
* PLT-6282 Changed SuggestionBox to complete suggestions without an event
Diffstat (limited to 'webapp/components/suggestion/suggestion_list.jsx')
-rw-r--r-- | webapp/components/suggestion/suggestion_list.jsx | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/webapp/components/suggestion/suggestion_list.jsx b/webapp/components/suggestion/suggestion_list.jsx index bc2245077..59f0d02f8 100644 --- a/webapp/components/suggestion/suggestion_list.jsx +++ b/webapp/components/suggestion/suggestion_list.jsx @@ -2,20 +2,19 @@ // See License.txt for license information. import $ from 'jquery'; +import PropTypes from 'prop-types'; +import React from 'react'; import ReactDOM from 'react-dom'; -import * as GlobalActions from 'actions/global_actions.jsx'; -import SuggestionStore from 'stores/suggestion_store.jsx'; import {FormattedMessage} from 'react-intl'; -import PropTypes from 'prop-types'; - -import React from 'react'; +import SuggestionStore from 'stores/suggestion_store.jsx'; export default class SuggestionList extends React.Component { static propTypes = { suggestionId: PropTypes.string.isRequired, location: PropTypes.string, - renderDividers: PropTypes.bool + renderDividers: PropTypes.bool, + onCompleteWord: PropTypes.func.isRequired }; static defaultProps = { @@ -29,7 +28,6 @@ export default class SuggestionList extends React.Component { this.getContent = this.getContent.bind(this); - this.handleItemClick = this.handleItemClick.bind(this); this.handleSuggestionsChanged = this.handleSuggestionsChanged.bind(this); this.scrollToItem = this.scrollToItem.bind(this); @@ -67,10 +65,6 @@ export default class SuggestionList extends React.Component { return $(ReactDOM.findDOMNode(this.refs.content)); } - handleItemClick(term, matchedPretext) { - GlobalActions.emitCompleteWordSuggestion(this.props.suggestionId, term, matchedPretext); - } - handleSuggestionsChanged() { this.setState(this.getStateFromStores()); } @@ -145,7 +139,7 @@ export default class SuggestionList extends React.Component { term={term} matchedPretext={this.state.matchedPretext[i]} isSelection={isSelection} - onClick={this.handleItemClick} + onClick={this.props.onCompleteWord} /> ); } |