From 6d10b103189168c556456319115774b41ee5ac73 Mon Sep 17 00:00:00 2001 From: hmhealey Date: Mon, 30 Nov 2015 16:20:42 -0500 Subject: Replaced MentionList and Mention components with AtMentionProvider --- web/react/components/suggestion_box.jsx | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) (limited to 'web/react/components/suggestion_box.jsx') diff --git a/web/react/components/suggestion_box.jsx b/web/react/components/suggestion_box.jsx index ddfcaf811..5510ba340 100644 --- a/web/react/components/suggestion_box.jsx +++ b/web/react/components/suggestion_box.jsx @@ -3,7 +3,6 @@ import AppDispatcher from '../dispatcher/app_dispatcher.jsx'; import Constants from '../utils/constants.jsx'; -import SuggestionList from './suggestion_list.jsx'; import SuggestionStore from '../stores/suggestion_store.jsx'; import * as Utils from '../utils/utils.jsx'; @@ -45,6 +44,11 @@ export default class SuggestionBox extends React.Component { $(document).off('click', this.handleDocumentClick); } + getTextbox() { + // this is to support old code that looks at the input/textarea DOM nodes + return ReactDOM.findDOMNode(this.refs.textbox); + } + handleDocumentClick(e) { if (!this.state.focused) { return; @@ -143,26 +147,48 @@ export default class SuggestionBox extends React.Component { } render() { + const SuggestionList = this.props.listComponent; + const newProps = Object.assign({}, this.props, { onFocus: this.handleFocus, onChange: this.handleChange, onKeyDown: this.handleKeyDown }); - return ( -
+ let textbox = null; + if (this.props.type === 'input') { + textbox = ( + ); + } else if (this.props.type === 'textarea') { + textbox = ( +