@@ -107,15 +107,15 @@ export class RenameInputField implements IContentWidget {
107
107
this . _input . className = 'rename-input' ;
108
108
this . _input . type = 'text' ;
109
109
this . _input . setAttribute ( 'aria-label' , localize ( 'renameAriaLabel' , "Rename input. Type new name and press Enter to commit." ) ) ;
110
- // TODO@ulugbekna : is using addDisposableListener's right way to do it?
111
110
this . _disposables . add ( addDisposableListener ( this . _input , 'focus' , ( ) => { this . _focusedContextKey . set ( true ) ; } ) ) ;
112
111
this . _disposables . add ( addDisposableListener ( this . _input , 'blur' , ( ) => { this . _focusedContextKey . reset ( ) ; } ) ) ;
113
112
this . _domNode . appendChild ( this . _input ) ;
114
113
115
- this . _candidatesView = new CandidatesView ( this . _domNode , {
116
- fontInfo : this . _editor . getOption ( EditorOption . fontInfo ) ,
117
- onSelectionChange : ( ) => this . acceptInput ( false ) // we don't allow preview with mouse click for now
118
- } ) ;
114
+ this . _candidatesView = this . _disposables . add (
115
+ new CandidatesView ( this . _domNode , {
116
+ fontInfo : this . _editor . getOption ( EditorOption . fontInfo ) ,
117
+ onSelectionChange : ( ) => this . acceptInput ( false ) // we don't allow preview with mouse click for now
118
+ } ) ) ;
119
119
120
120
this . _label = document . createElement ( 'div' ) ;
121
121
this . _label . className = 'rename-label' ;
@@ -562,6 +562,10 @@ export class CandidatesView {
562
562
}
563
563
return focusedIx > 0 ;
564
564
}
565
+
566
+ dispose ( ) {
567
+ this . _listWidget . dispose ( ) ;
568
+ }
565
569
}
566
570
567
571
export class CandidateView { // TODO@ulugbekna : remove export
0 commit comments