Fixing how escape key works in listWidget (#110760)

This commit is contained in:
Aasim Khan 2020-11-25 02:42:04 -08:00 committed by GitHub
parent 7bbf45c14e
commit 221a5570b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -318,10 +318,12 @@ class KeyboardController<T> implements IDisposable {
}
private onEscape(e: StandardKeyboardEvent): void {
e.preventDefault();
e.stopPropagation();
this.list.setSelection([], e.browserEvent);
this.view.domNode.focus();
if (this.list.getSelection().length) {
e.preventDefault();
e.stopPropagation();
this.list.setSelection([], e.browserEvent);
this.view.domNode.focus();
}
}
dispose() {