This repository was archived by the owner on Sep 11, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +4
-17
lines changed
src/components/views/rooms Expand file tree Collapse file tree 2 files changed +4
-17
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,6 @@ export default class MessageComposer extends React.Component {
3636 this . onInputContentChanged = this . onInputContentChanged . bind ( this ) ;
3737 this . onUpArrow = this . onUpArrow . bind ( this ) ;
3838 this . onDownArrow = this . onDownArrow . bind ( this ) ;
39- this . onTab = this . onTab . bind ( this ) ;
4039 this . _tryComplete = this . _tryComplete . bind ( this ) ;
4140 this . _onAutocompleteConfirm = this . _onAutocompleteConfirm . bind ( this ) ;
4241
@@ -143,12 +142,6 @@ export default class MessageComposer extends React.Component {
143142 return this . refs . autocomplete . onDownArrow ( ) ;
144143 }
145144
146- onTab ( ) {
147- // FIXME Autocomplete doesn't have an onTab - what is this supposed to do?
148- // return this.refs.autocomplete.onTab();
149- return false ;
150- }
151-
152145 _tryComplete ( ) : boolean {
153146 if ( this . refs . autocomplete ) {
154147 return this . refs . autocomplete . onConfirm ( ) ;
@@ -223,7 +216,6 @@ export default class MessageComposer extends React.Component {
223216 tryComplete = { this . _tryComplete }
224217 onUpArrow = { this . onUpArrow }
225218 onDownArrow = { this . onDownArrow }
226- onTab = { this . onTab }
227219 tabComplete = { this . props . tabComplete } // used for old messagecomposerinput/tabcomplete
228220 onContentChanged = { this . onInputContentChanged } /> ,
229221 uploadButton ,
Original file line number Diff line number Diff line change @@ -422,12 +422,6 @@ export default class MessageComposerInput extends React.Component {
422422 if ( ev . shiftKey ) {
423423 return false ;
424424 }
425-
426- if ( this . props . tryComplete ) {
427- if ( this . props . tryComplete ( ) ) {
428- return true ;
429- }
430- }
431425
432426 const contentState = this . state . editorState . getCurrentContent ( ) ;
433427 if ( ! contentState . hasText ( ) ) {
@@ -519,8 +513,8 @@ export default class MessageComposerInput extends React.Component {
519513 }
520514
521515 onTab ( e ) {
522- if ( this . props . onTab ) {
523- if ( this . props . onTab ( ) ) {
516+ if ( this . props . tryComplete ) {
517+ if ( this . props . tryComplete ( ) ) {
524518 e . preventDefault ( ) ;
525519 }
526520 }
@@ -585,5 +579,6 @@ MessageComposerInput.propTypes = {
585579
586580 onDownArrow : React . PropTypes . func ,
587581
588- onTab : React . PropTypes . func
582+ // attempts to confirm currently selected completion, returns whether actually confirmed
583+ tryComplete : React . PropTypes . func ,
589584} ;
You can’t perform that action at this time.
0 commit comments