@@ -431,6 +431,7 @@ class ReactTextareaAutocomplete extends React.Component {
431431 'closeOnClickOutside' ,
432432 'containerClassName' ,
433433 'containerStyle' ,
434+ 'disableMentions' ,
434435 'dropdownClassName' ,
435436 'dropdownStyle' ,
436437 'grow' ,
@@ -623,6 +624,7 @@ class ReactTextareaAutocomplete extends React.Component {
623624 className,
624625 containerClassName,
625626 containerStyle,
627+ disableMentions,
626628 dropdownClassName,
627629 dropdownStyle,
628630 itemClassName,
@@ -632,23 +634,21 @@ class ReactTextareaAutocomplete extends React.Component {
632634 SuggestionList = DefaultSuggestionList ,
633635 } = this . props ;
634636
637+ let { maxRows } = this . props ;
638+
635639 const { component, currentTrigger, dataLoading, value } = this . state ;
636640
637641 const selectedItem = this . _getItemOnSelect ( ) ;
638642 const suggestionData = this . _getSuggestions ( ) ;
639643 const textToReplace = this . _getTextToReplace ( ) ;
640644
641- let { maxRows } = this . props ;
642- if ( ! this . props . grow ) maxRows = 1 ;
643-
644- return (
645- < div
646- className = { `rta ${ dataLoading === true ? 'rta--loading' : '' } ${
647- containerClassName || ''
648- } `}
649- style = { containerStyle }
650- >
651- { ( dataLoading || suggestionData ) && currentTrigger && (
645+ const SuggestionListContainer = ( ) => {
646+ if (
647+ ( dataLoading || suggestionData ) &&
648+ currentTrigger &&
649+ ! ( disableMentions && currentTrigger === '@' )
650+ ) {
651+ return (
652652 < div
653653 className = { `rta__autocomplete ${ dropdownClassName || '' } ` }
654654 ref = { ( ref ) => {
@@ -671,7 +671,21 @@ class ReactTextareaAutocomplete extends React.Component {
671671 />
672672 ) }
673673 </ div >
674- ) }
674+ ) ;
675+ }
676+ return null ;
677+ } ;
678+
679+ if ( ! this . props . grow ) maxRows = 1 ;
680+
681+ return (
682+ < div
683+ className = { `rta ${ dataLoading === true ? 'rta--loading' : '' } ${
684+ containerClassName || ''
685+ } `}
686+ style = { containerStyle }
687+ >
688+ < SuggestionListContainer />
675689 < Textarea
676690 { ...this . _cleanUpProps ( ) }
677691 className = { `rta__textarea ${ className || '' } ` }
@@ -700,6 +714,7 @@ ReactTextareaAutocomplete.propTypes = {
700714 closeOnClickOutside : PropTypes . bool ,
701715 containerClassName : PropTypes . string ,
702716 containerStyle : PropTypes . object ,
717+ disableMentions : PropTypes . bool ,
703718 dropdownClassName : PropTypes . string ,
704719 dropdownStyle : PropTypes . object ,
705720 itemClassName : PropTypes . string ,
0 commit comments