@@ -52,6 +52,8 @@ class Composer extends React.Component {
5252 this . handleEnter = this . handleEnter . bind ( this ) ;
5353 this . handleTextChange = this . handleTextChange . bind ( this ) ;
5454 this . handleMentionSelect = this . handleMentionSelect . bind ( this ) ;
55+ this . handleMentionOpen = this . handleMentionOpen . bind ( this ) ;
56+ this . handleMentionClose = this . handleMentionClose . bind ( this ) ;
5557 this . saveToDraft = this . saveToDraft . bind ( this ) ;
5658 this . openMentionList = this . openMentionList . bind ( this ) ;
5759 this . handleFocus = this . handleFocus . bind ( this ) ;
@@ -96,6 +98,8 @@ class Composer extends React.Component {
9698 defaultMenuOrientation : 'top' ,
9799 mentionDenotationChars : [ '@' ] ,
98100 onSelect : this . handleMentionSelect ,
101+ onOpen : this . handleMentionOpen ,
102+ onClose : this . handleMentionClose ,
99103 renderItem : this . handleMentionItem ,
100104 source : this . handleMention . bind ( this ) ,
101105 spaceAfterInsert : false ,
@@ -338,6 +342,22 @@ class Composer extends React.Component {
338342 }
339343 }
340344
345+ handleMentionOpen ( ) {
346+ const { onMentionOpen} = this . props ;
347+
348+ if ( onMentionOpen ) {
349+ onMentionOpen ( ) ;
350+ }
351+ }
352+
353+ handleMentionClose ( ) {
354+ const { onMentionClose} = this . props ;
355+
356+ if ( onMentionClose ) {
357+ onMentionClose ( ) ;
358+ }
359+ }
360+
341361 handleTextChange ( delta , oldDelta , source ) {
342362 const { notifyKeyDown} = this . props ;
343363
@@ -443,6 +463,8 @@ Composer.propTypes = {
443463 } ) ,
444464 } ) ,
445465 notifyKeyDown : PropTypes . func ,
466+ onMentionClose : PropTypes . func ,
467+ onMentionOpen : PropTypes . func ,
446468 onError : PropTypes . func ,
447469 placeholder : PropTypes . string ,
448470 send : PropTypes . func ,
@@ -454,6 +476,8 @@ Composer.defaultProps = {
454476 markdown : undefined ,
455477 mentions : undefined ,
456478 notifyKeyDown : undefined ,
479+ onMentionClose : undefined ,
480+ onMentionOpen : undefined ,
457481 onError : undefined ,
458482 placeholder : 'Compose something awesome...' ,
459483 send : undefined ,
0 commit comments