@@ -73,6 +73,9 @@ export default class MessageComposerInput extends React.Component {
7373 this . handleReturn = this . handleReturn . bind ( this ) ;
7474 this . handleKeyCommand = this . handleKeyCommand . bind ( this ) ;
7575 this . setEditorState = this . setEditorState . bind ( this ) ;
76+ this . onUpArrow = this . onUpArrow . bind ( this ) ;
77+ this . onDownArrow = this . onDownArrow . bind ( this ) ;
78+ this . onTab = this . onTab . bind ( this ) ;
7679
7780 let isRichtextEnabled = window . localStorage . getItem ( 'mx_editor_rte_enabled' ) ;
7881 if ( isRichtextEnabled == null ) {
@@ -489,6 +492,30 @@ export default class MessageComposerInput extends React.Component {
489492 return true ;
490493 }
491494
495+ onUpArrow ( e ) {
496+ if ( this . props . onUpArrow ) {
497+ if ( this . props . onUpArrow ( ) ) {
498+ e . preventDefault ( ) ;
499+ }
500+ }
501+ }
502+
503+ onDownArrow ( e ) {
504+ if ( this . props . onDownArrow ) {
505+ if ( this . props . onDownArrow ( ) ) {
506+ e . preventDefault ( ) ;
507+ }
508+ }
509+ }
510+
511+ onTab ( e ) {
512+ if ( this . props . onTab ) {
513+ if ( this . props . onTab ( ) ) {
514+ e . preventDefault ( ) ;
515+ }
516+ }
517+ }
518+
492519 render ( ) {
493520 let className = "mx_MessageComposer_input" ;
494521
@@ -507,6 +534,9 @@ export default class MessageComposerInput extends React.Component {
507534 handleKeyCommand = { this . handleKeyCommand }
508535 handleReturn = { this . handleReturn }
509536 stripPastedStyles = { ! this . state . isRichtextEnabled }
537+ onTab = { this . onTab }
538+ onUpArrow = { this . onUpArrow }
539+ onDownArrow = { this . onDownArrow }
510540 spellCheck = { true } />
511541 </ div >
512542 ) ;
@@ -524,5 +554,11 @@ MessageComposerInput.propTypes = {
524554 room : React . PropTypes . object . isRequired ,
525555
526556 // called with current plaintext content (as a string) whenever it changes
527- onContentChanged : React . PropTypes . func
557+ onContentChanged : React . PropTypes . func ,
558+
559+ onUpArrow : React . PropTypes . func ,
560+
561+ onDownArrow : React . PropTypes . func ,
562+
563+ onTab : React . PropTypes . func
528564} ;
0 commit comments