@@ -453,6 +453,19 @@ export default Ember.Component.extend({
453453 this . set ( 'caretPosition' , caretPosition + 1 ) ;
454454 } ,
455455
456+ /**
457+ * starts the typing state if enabled
458+ */
459+ runShowTypingState ( ) {
460+ // TODO: figure out if this has to be run on up/down
461+ if ( this . get ( 'shouldShowTypingState' ) ) {
462+ this . set ( 'showTypingState' , true ) ;
463+ run . later ( this , ( ) => {
464+ this . set ( 'showTypingState' , false ) ;
465+ } , this . get ( 'typingStateTimeout' ) ) ;
466+ }
467+ } ,
468+
456469 /**
457470 * Function called on target 'keydown'. Used to handle "special" key presses.
458471 * @param {jQuery.Event } ev
@@ -508,14 +521,6 @@ export default Ember.Component.extend({
508521 }
509522 }
510523
511- // TODO: figure out if this has to be run on up/down
512- if ( visible && this . get ( 'shouldShowTypingState' ) ) {
513- this . set ( 'showTypingState' , true ) ;
514- run . later ( this , ( ) => {
515- this . set ( 'showTypingState' , false ) ;
516- } , this . get ( 'typingStateTimeout' ) ) ;
517- }
518-
519524 let selectionIdx = this . get ( 'selectionIdx' ) ;
520525 switch ( keyCode ) {
521526 case KEYS . ENTER :
@@ -571,6 +576,10 @@ export default Ember.Component.extend({
571576 }
572577 break ;
573578 }
579+ default :
580+ if ( visible ) {
581+ this . runShowTypingState ( )
582+ }
574583 }
575584 } ,
576585
0 commit comments