mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 13:46:13 +00:00
Fix for Sticky Scroll Focus Space Key Issue (#203314)
sticky scroll focus "Space" fix
This commit is contained in:
parent
205e4e53a1
commit
c75ad1fd11
|
@ -1767,8 +1767,10 @@ class StickyScrollFocus<T, TFilterData, TRef> extends Disposable {
|
|||
private _domHasFocus: boolean = false;
|
||||
private get domHasFocus(): boolean { return this._domHasFocus; }
|
||||
private set domHasFocus(hasFocus: boolean) {
|
||||
this._domHasFocus = hasFocus;
|
||||
this._onDidChangeHasFocus.fire(hasFocus);
|
||||
if (hasFocus !== this._domHasFocus) {
|
||||
this._onDidChangeHasFocus.fire(hasFocus);
|
||||
this._domHasFocus = hasFocus;
|
||||
}
|
||||
}
|
||||
|
||||
constructor(
|
||||
|
|
|
@ -266,7 +266,7 @@ function revealFocusedStickyScroll(tree: ObjectTree<any, any> | DataTree<any, an
|
|||
}
|
||||
|
||||
tree.reveal(focus[0]);
|
||||
tree.domFocus();
|
||||
tree.getHTMLElement().focus(); // domfocus() would focus stiky scroll dom and not the tree todo@benibenj
|
||||
tree.setFocus(focus);
|
||||
postRevealAction?.(focus[0]);
|
||||
}
|
||||
|
@ -718,7 +718,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|||
});
|
||||
|
||||
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
||||
id: 'list.toggleExpand',
|
||||
id: 'list.stickyScrolltoggleExpand',
|
||||
weight: KeybindingWeight.WorkbenchContrib + 50, // priorities over file explorer
|
||||
when: WorkbenchTreeStickyScrollFocused,
|
||||
primary: KeyCode.Space,
|
||||
|
@ -729,7 +729,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|||
return;
|
||||
}
|
||||
|
||||
revealFocusedStickyScroll(widget, focus => widget.setSelection([focus]));
|
||||
revealFocusedStickyScroll(widget);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue