Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix webviewFindWidget focus steal, fixes #127456 #128176

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import { MultiCommand, RedoCommand, SelectAllCommand, UndoCommand } from 'vs/edi
import { CopyAction, CutAction, PasteAction } from 'vs/editor/contrib/clipboard/clipboard';
import * as nls from 'vs/nls';
import { MenuId, MenuRegistry } from 'vs/platform/actions/common/actions';
import { IWebviewService, Webview } from 'vs/workbench/contrib/webview/browser/webview';
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { IWebviewService, KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_FOCUSED, Webview } from 'vs/workbench/contrib/webview/browser/webview';
import { WebviewInput } from 'vs/workbench/contrib/webviewPanel/browser/webviewEditorInput';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';

Expand All @@ -23,6 +24,13 @@ function overrideCommandForWebview(command: MultiCommand | undefined, f: (webvie
return true;
}

// required for copy/paste to work in the find inputbox
const contextKeyService = accessor.get(IContextKeyService);
if (KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_FOCUSED.getValue(contextKeyService)) {
return false;
}

// required for the copy/paste context menu to work
const editorService = accessor.get(IEditorService);
if (editorService.activeEditor instanceof WebviewInput) {
f(editorService.activeEditor.webview);
Expand Down