@@ -30,7 +30,7 @@ export default class MUCMessageForm extends MessageForm {
3030 }
3131
3232 initMentionAutoComplete ( ) {
33- this . mention_auto_complete = new AutoComplete ( this , {
33+ this . auto_complete = new AutoComplete ( this , {
3434 auto_first : true ,
3535 min_chars : api . settings . get ( "muc_mention_autocomplete_min_chars" ) ,
3636 match_current_word : true ,
@@ -41,7 +41,7 @@ export default class MUCMessageForm extends MessageForm {
4141 include_triggers : [ ] ,
4242 item : ( text , input ) => getAutoCompleteListItem ( this . model , text , input ) ,
4343 } ) ;
44- this . mention_auto_complete . on ( "suggestion-box-selectcomplete" , ( ) => ( this . auto_completing = false ) ) ;
44+ this . auto_complete . on ( "suggestion-box-selectcomplete" , ( ) => ( this . auto_completing = false ) ) ;
4545 }
4646
4747 getAutoCompleteList ( ) {
@@ -52,7 +52,7 @@ export default class MUCMessageForm extends MessageForm {
5252 * @param {KeyboardEvent } ev
5353 */
5454 onKeyDown ( ev ) {
55- if ( this . shouldAutoComplete ( ) && this . mention_auto_complete . onKeyDown ( ev ) ) {
55+ if ( this . shouldAutoComplete ( ) && this . auto_complete . onKeyDown ( ev ) ) {
5656 return ;
5757 }
5858 super . onKeyDown ( ev ) ;
@@ -62,7 +62,9 @@ export default class MUCMessageForm extends MessageForm {
6262 * @param {KeyboardEvent } ev
6363 */
6464 onKeyUp ( ev ) {
65- if ( this . shouldAutoComplete ( ) ) this . mention_auto_complete . evaluate ( ev ) ;
65+ if ( this . shouldAutoComplete ( ) && this . auto_complete . auto_completing ) {
66+ this . auto_complete . evaluate ( ev ) ;
67+ }
6668 super . onKeyUp ( ev ) ;
6769 }
6870}
0 commit comments