Skip to content

handle webview focus on webviewWorkbenchService #139050

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

juliombb
Copy link

This PR fixes #131289

WebviewService.onDidChangeActiveWebview is fired whenever focus or blur events happen. We can update the active webview when the focus is lost, triggering correct status changes.

@@ -177,15 +177,15 @@ export class WebviewEditorService extends Disposable implements IWebviewWorkbenc
this._iconManager = this._register(this._instantiationService.createInstance(WebviewIconManager));

this._register(_editorService.onDidActiveEditorChange(() => {
this.updateActiveWebview();
this.updateActiveWebview(true);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isFocused == true doesn't make sense to me here. I think the parameter either needs to be renamed or we should fix this another way

}));

this.updateActiveWebview();
this.updateActiveWebview(true);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also seems incorrect to assume a webview is focused on init

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] markdownPreviewFocus is true even if the markdown preview isn't focused
2 participants