提交 53653fbe 编写于 作者: R Rob Lourens

Fix #42842 - tree event now fires even when focus is not inside the tree,

listen to onDidFocus and keep track of whether focus is inside the tree
上级 5a8934a1
......@@ -525,16 +525,24 @@ export class SearchViewlet extends Viewlet {
}
}));
let treeHasFocus = false;
this.tree.onDidFocus(() => {
treeHasFocus = true;
});
this.toUnbind.push(this.tree.onDidChangeFocus((e: IFocusEvent) => {
const focus = e.focus;
this.firstMatchFocused.set(this.tree.getNavigator().first() === focus);
this.fileMatchOrMatchFocused.set(true);
this.fileMatchFocused.set(focus instanceof FileMatch);
this.folderMatchFocused.set(focus instanceof FolderMatch);
this.matchFocused.set(focus instanceof Match);
if (treeHasFocus) {
const focus = e.focus;
this.firstMatchFocused.set(this.tree.getNavigator().first() === focus);
this.fileMatchOrMatchFocused.set(true);
this.fileMatchFocused.set(focus instanceof FileMatch);
this.folderMatchFocused.set(focus instanceof FolderMatch);
this.matchFocused.set(focus instanceof Match);
}
}));
this.toUnbind.push(this.tree.onDidBlur(e => {
treeHasFocus = false;
this.firstMatchFocused.reset();
this.fileMatchOrMatchFocused.reset();
this.fileMatchFocused.reset();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册