未验证 提交 260fce98 编写于 作者: R Rob Lourens

Fix #31496 - don't take selected text when focus is already in the search viewlet

上级 50b82f68
......@@ -640,10 +640,14 @@ export class SearchViewlet extends Viewlet {
public focus(): void {
super.focus();
let selectedText = this.getSearchTextFromEditor();
if (selectedText) {
this.searchWidget.searchInput.setValue(selectedText);
// If focus is inside the search viewlet, don't add the selected text to the search widget
if (!(document.activeElement.compareDocumentPosition(this.domNode.getHTMLElement()) & Node.DOCUMENT_POSITION_CONTAINS)) {
const selectedText = this.getSearchTextFromEditor();
if (selectedText) {
this.searchWidget.searchInput.setValue(selectedText);
}
}
this.searchWidget.focus();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册