@@ -19,6 +19,7 @@ import { ScrollbarVisibility } from 'vs/base/common/scrollable';
1919import { ISelectBoxDelegate , ISelectOptionItem , ISelectBoxOptions , ISelectBoxStyles , ISelectData } from 'vs/base/browser/ui/selectBox/selectBox' ;
2020import { isMacintosh } from 'vs/base/common/platform' ;
2121import { renderMarkdown } from 'vs/base/browser/markdownRenderer' ;
22+ import { IContentActionHandler } from 'vs/base/browser/formattedTextRenderer' ;
2223
2324const $ = dom . $ ;
2425
@@ -748,11 +749,16 @@ export class SelectBoxList extends Disposable implements ISelectBoxDelegate, ILi
748749 . filter ( ( ) => this . selectList . length > 0 )
749750 . on ( e => this . onMouseUp ( e ) , this ) ) ;
750751
751-
752- this . _register ( this . selectList . onDidBlur ( _ => this . onListBlur ( ) ) ) ;
753752 this . _register ( this . selectList . onMouseOver ( e => typeof e . index !== 'undefined' && this . selectList . setFocus ( [ e . index ] ) ) ) ;
754753 this . _register ( this . selectList . onFocusChange ( e => this . onListFocus ( e ) ) ) ;
755754
755+ this . _register ( dom . addDisposableListener ( this . selectDropDownContainer , dom . EventType . FOCUS_OUT , e => {
756+ if ( ! this . _isVisible || dom . isAncestor ( e . relatedTarget as HTMLElement , this . selectDropDownContainer ) ) {
757+ return ;
758+ }
759+ this . onListBlur ( ) ;
760+ } ) ) ;
761+
756762 this . selectList . getHTMLElement ( ) . setAttribute ( 'aria-label' , this . selectBoxOptions . ariaLabel || '' ) ;
757763 this . selectList . getHTMLElement ( ) . setAttribute ( 'aria-expanded' , 'true' ) ;
758764
@@ -823,7 +829,7 @@ export class SelectBoxList extends Disposable implements ISelectBoxDelegate, ILi
823829 }
824830
825831
826- private renderDescriptionMarkdown ( text : string ) : HTMLElement {
832+ private renderDescriptionMarkdown ( text : string , actionHandler ?: IContentActionHandler ) : HTMLElement {
827833 const cleanRenderedMarkdown = ( element : Node ) => {
828834 for ( let i = 0 ; i < element . childNodes . length ; i ++ ) {
829835 const child = < Element > element . childNodes . item ( i ) ;
@@ -837,7 +843,7 @@ export class SelectBoxList extends Disposable implements ISelectBoxDelegate, ILi
837843 }
838844 } ;
839845
840- const renderedMarkdown = renderMarkdown ( { value : text } ) ;
846+ const renderedMarkdown = renderMarkdown ( { value : text } , { actionHandler } ) ;
841847
842848 renderedMarkdown . classList . add ( 'select-box-description-markdown' ) ;
843849 cleanRenderedMarkdown ( renderedMarkdown ) ;
@@ -859,7 +865,8 @@ export class SelectBoxList extends Disposable implements ISelectBoxDelegate, ILi
859865
860866 if ( description ) {
861867 if ( descriptionIsMarkdown ) {
862- this . selectionDetailsPane . appendChild ( this . renderDescriptionMarkdown ( description ) ) ;
868+ const actionHandler = this . options [ selectedIndex ] . descriptionMarkdownActionHandler ;
869+ this . selectionDetailsPane . appendChild ( this . renderDescriptionMarkdown ( description , actionHandler ) ) ;
863870 } else {
864871 this . selectionDetailsPane . innerText = description ;
865872 }
@@ -872,7 +879,6 @@ export class SelectBoxList extends Disposable implements ISelectBoxDelegate, ILi
872879 this . _skipLayout = true ;
873880 this . contextViewProvider . layout ( ) ;
874881 this . _skipLayout = false ;
875-
876882 }
877883
878884 // List keyboard controller
0 commit comments