mirror of
https://github.com/microsoft/vscode.git
synced 2026-09-12 11:39:57 +01:00
fixes #131938
This commit is contained in:
@@ -307,7 +307,9 @@ class KeyboardController<T> implements IDisposable {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
this.list.focusPrevious(1, false, e.browserEvent);
|
||||
this.list.reveal(this.list.getFocus()[0]);
|
||||
const el = this.list.getFocus()[0];
|
||||
this.list.setAnchor(el);
|
||||
this.list.reveal(el);
|
||||
this.view.domNode.focus();
|
||||
}
|
||||
|
||||
@@ -315,7 +317,9 @@ class KeyboardController<T> implements IDisposable {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
this.list.focusNext(1, false, e.browserEvent);
|
||||
this.list.reveal(this.list.getFocus()[0]);
|
||||
const el = this.list.getFocus()[0];
|
||||
this.list.setAnchor(el);
|
||||
this.list.reveal(el);
|
||||
this.view.domNode.focus();
|
||||
}
|
||||
|
||||
@@ -323,7 +327,9 @@ class KeyboardController<T> implements IDisposable {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
this.list.focusPreviousPage(e.browserEvent);
|
||||
this.list.reveal(this.list.getFocus()[0]);
|
||||
const el = this.list.getFocus()[0];
|
||||
this.list.setAnchor(el);
|
||||
this.list.reveal(el);
|
||||
this.view.domNode.focus();
|
||||
}
|
||||
|
||||
@@ -331,7 +337,9 @@ class KeyboardController<T> implements IDisposable {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
this.list.focusNextPage(e.browserEvent);
|
||||
this.list.reveal(this.list.getFocus()[0]);
|
||||
const el = this.list.getFocus()[0];
|
||||
this.list.setAnchor(el);
|
||||
this.list.reveal(el);
|
||||
this.view.domNode.focus();
|
||||
}
|
||||
|
||||
@@ -339,6 +347,7 @@ class KeyboardController<T> implements IDisposable {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
this.list.setSelection(range(this.list.length), e.browserEvent);
|
||||
this.list.setAnchor(undefined);
|
||||
this.view.domNode.focus();
|
||||
}
|
||||
|
||||
@@ -347,6 +356,7 @@ class KeyboardController<T> implements IDisposable {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
this.list.setSelection([], e.browserEvent);
|
||||
this.list.setAnchor(undefined);
|
||||
this.view.domNode.focus();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,6 +61,7 @@ async function navigate(widget: WorkbenchListWidget | undefined, updateFocusFn:
|
||||
widget.reveal(listFocus[0]);
|
||||
}
|
||||
|
||||
widget.setAnchor(listFocus[0]);
|
||||
ensureDOMFocus(widget);
|
||||
}
|
||||
|
||||
@@ -404,6 +405,7 @@ function selectElement(accessor: ServicesAccessor, retainCurrentFocus: boolean):
|
||||
if (focused instanceof List || focused instanceof PagedList || focused instanceof Table) {
|
||||
const list = focused;
|
||||
list.setSelection(list.getFocus(), fakeKeyboardEvent);
|
||||
list.setAnchor(list.getFocus()[0]);
|
||||
}
|
||||
|
||||
// Trees
|
||||
@@ -425,6 +427,7 @@ function selectElement(accessor: ServicesAccessor, retainCurrentFocus: boolean):
|
||||
}
|
||||
}
|
||||
tree.setSelection(focus, fakeKeyboardEvent);
|
||||
tree.setAnchor(focus[0]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user