@@ -294,7 +294,7 @@ class Lookup extends DropDownList<LookupProperties> {
294294 } ) ;
295295 }
296296
297- _fireContentReadyAction ( ) { }
297+ _fireContentReadyAction ( ) { }
298298
299299 _popupWrapperClass ( ) {
300300 return '' ;
@@ -371,7 +371,7 @@ class Lookup extends DropDownList<LookupProperties> {
371371 }
372372 }
373373
374- _renderButtonContainers ( ) : void { }
374+ _renderButtonContainers ( ) : void { }
375375
376376 _renderFieldTemplate ( template ) {
377377 this . _$field . empty ( ) ;
@@ -671,7 +671,7 @@ class Lookup extends DropDownList<LookupProperties> {
671671 }
672672 }
673673
674- _preventFocusOnPopup ( ) : void { }
674+ _preventFocusOnPopup ( ) : void { }
675675
676676 _shouldLoopFocusInsidePopup ( ) : boolean {
677677 const {
@@ -765,32 +765,43 @@ class Lookup extends DropDownList<LookupProperties> {
765765 }
766766
767767 _popupToolbarItemsConfig ( ) {
768+ const { focusStateEnabled, applyButtonText : text } = this . option ( ) ;
769+
768770 return [
769771 {
770772 shortcut : 'done' ,
771773 options : {
774+ text,
775+ focusStateEnabled,
772776 onClick : this . _applyButtonHandler . bind ( this ) ,
773- text : this . option ( 'applyButtonText' ) ,
774777 } ,
775778 } ,
776779 ] ;
777780 }
778781
779782 _getCancelButtonConfig ( ) {
780- return this . option ( 'showCancelButton' ) ? {
783+ const { focusStateEnabled, cancelButtonText : text , showCancelButton } = this . option ( ) ;
784+
785+ return showCancelButton ? {
781786 shortcut : 'cancel' ,
782- onClick : this . _cancelButtonHandler . bind ( this ) ,
783787 options : {
784- text : this . option ( 'cancelButtonText' ) ,
788+ text,
789+ focusStateEnabled,
785790 } ,
791+ onClick : this . _cancelButtonHandler . bind ( this ) ,
786792 } : null ;
787793 }
788794
789795 _getClearButtonConfig ( ) {
790- return this . option ( 'showClearButton' ) ? {
796+ const { showClearButton, clearButtonText : text , focusStateEnabled } = this . option ( ) ;
797+
798+ return showClearButton ? {
791799 shortcut : 'clear' ,
800+ options : {
801+ text,
802+ focusStateEnabled,
803+ } ,
792804 onClick : this . _resetValue . bind ( this ) ,
793- options : { text : this . option ( 'clearButtonText' ) } ,
794805 } : null ;
795806 }
796807
@@ -832,7 +843,7 @@ class Lookup extends DropDownList<LookupProperties> {
832843 this . _renderSearch ( ) ;
833844 }
834845
835- _renderValueChangeEvent ( ) : void { }
846+ _renderValueChangeEvent ( ) : void { }
836847
837848 _renderSearch ( ) : void {
838849 const isSearchEnabled = this . option ( 'searchEnabled' ) ;
@@ -861,8 +872,10 @@ class Lookup extends DropDownList<LookupProperties> {
861872 onDisposing : ( ) => isKeyboardListeningEnabled = false ,
862873 // eslint-disable-next-line no-return-assign
863874 onFocusIn : ( ) => isKeyboardListeningEnabled = true ,
864- // eslint-disable-next-line no-return-assign
865- onFocusOut : ( ) => isKeyboardListeningEnabled = false ,
875+ onFocusOut : ( ) => {
876+ isKeyboardListeningEnabled = false ;
877+ this . _list ?. option ( 'focusedElement' , null ) ;
878+ } ,
866879 // @ts -expect-error ts-error
867880 onKeyboardHandled : ( opts ) => isKeyboardListeningEnabled && this . _list . _keyboardHandler ( opts ) ,
868881 onValueChanged : ( e ) => this . _searchHandler ( e ) ,
@@ -954,11 +967,11 @@ class Lookup extends DropDownList<LookupProperties> {
954967 this . _searchBox ?. option ( 'placeholder' , placeholder ) ;
955968 }
956969
957- _setAriaTargetForList ( ) : void { }
970+ _setAriaTargetForList ( ) : void { }
958971
959972 _listConfig ( ) {
960973 return extend ( super . _listConfig ( ) , {
961- tabIndex : 0 ,
974+ tabIndex : this . option ( 'searchEnabled' ) ? - 1 : 0 ,
962975 grouped : this . option ( 'grouped' ) ,
963976 groupTemplate : this . _getTemplateByOption ( 'groupTemplate' ) ,
964977 pullRefreshEnabled : this . option ( 'pullRefreshEnabled' ) ,
@@ -1093,6 +1106,7 @@ class Lookup extends DropDownList<LookupProperties> {
10931106 this . _removeSearch ( ) ;
10941107 this . _renderSearch ( ) ;
10951108 }
1109+ this . _setListOption ( 'tabindex' , value ? - 1 : 0 ) ;
10961110 break ;
10971111 case 'searchPlaceholder' :
10981112 this . _setSearchPlaceholder ( ) ;
0 commit comments