File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
src/vs/workbench/contrib/preferences/browser Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -177,7 +177,7 @@ export class DefineKeybindingWidget extends Widget {
177
177
this . _keybindingInputWidget . startRecordingKeys ( ) ;
178
178
this . _register ( this . _keybindingInputWidget . onKeybinding ( keybinding => this . onKeybinding ( keybinding ) ) ) ;
179
179
this . _register ( this . _keybindingInputWidget . onEnter ( ( ) => this . hide ( ) ) ) ;
180
- this . _register ( this . _keybindingInputWidget . onEscape ( ( ) => this . onCancel ( ) ) ) ;
180
+ this . _register ( this . _keybindingInputWidget . onEscape ( ( ) => this . clearOrHide ( ) ) ) ;
181
181
this . _register ( this . _keybindingInputWidget . onBlur ( ( ) => this . onCancel ( ) ) ) ;
182
182
183
183
this . _outputNode = dom . append ( this . _domNode . domNode , dom . $ ( '.output' ) ) ;
@@ -273,6 +273,17 @@ export class DefineKeybindingWidget extends Widget {
273
273
this . hide ( ) ;
274
274
}
275
275
276
+ private clearOrHide ( ) : void {
277
+ if ( this . _chords === null ) {
278
+ this . hide ( ) ;
279
+ } else {
280
+ this . _chords = null ;
281
+ this . _keybindingInputWidget . clear ( ) ;
282
+ dom . clearNode ( this . _outputNode ) ;
283
+ dom . clearNode ( this . _showExistingKeybindingsNode ) ;
284
+ }
285
+ }
286
+
276
287
private hide ( ) : void {
277
288
this . _domNode . setDisplay ( 'none' ) ;
278
289
this . _isVisible = false ;
You can’t perform that action at this time.
0 commit comments