提交 d6bd346d 编写于 作者: B Benjamin Pasero

Editor loses focus when you click or drag the window title bar (fixes #30967)

上级 0d53acce
......@@ -265,6 +265,17 @@ export class TitlebarPart extends Part implements ITitleService {
}
});
// Since the title area is used to drag the window, we do not want to steal focus from the
// currently active element. So we restore focus after a timeout back to where it was.
this.titleContainer.on([DOM.EventType.MOUSE_DOWN], () => {
const active = document.activeElement;
setTimeout(() => {
if (active instanceof HTMLElement) {
active.focus();
}
}, 0 /* need a timeout because we are in capture phase */);
}, void 0, true /* use capture to know the currently active element properly */);
return this.titleContainer;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册