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

Context menus make webview on the side steal focus #212679

Open
mhuisi opened this issue May 14, 2024 · 1 comment
Open

Context menus make webview on the side steal focus #212679

mhuisi opened this issue May 14, 2024 · 1 comment
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug webview Webview issues

Comments

@mhuisi
Copy link

mhuisi commented May 14, 2024

Does this issue occur when all extensions are disabled?: Yes

Version: 1.90.0-insider
Commit: bbc4ba1eff648ee542972589216f211b7a6a08f2
Date: 2024-05-14T05:47:50.971Z
Electron: 29.3.1
ElectronBuildId: 9464424
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0
OS: Linux x64 6.8.8-300.fc40.x86_64

This bug has also been confirmed to occur on 1.88 and 1.89, but not 1.87.

Steps to Reproduce:

  1. Open an untitled document and a webview panel next to it (for example, a markdown document and its markdown preview)
  2. Right click in the untitled document, in the side bar or click an entry with a menu in the title bar
  3. Observe that the webview panel becomes focused and the title bar entries jump over to the webview panel

focus_bug

Context:

In the VS Code extension for the Lean 4 programming language and theorem prover, we use a webview to provide additional information about the Lean document that the user is currently working on. We also use a title bar menu entry for all of our commands. The webview stealing the focus from the text document creates several very annoying issues while working on Lean documents:

  • Right clicking an identifier in the Lean document and selecting "Go to Definition", "Find References" or "Show Call Hierarchy" will open documents in the tab group of the webview, not that of the editor, covering the webview and displaying the contents of the opened file in a panel that is typically smaller than the editor panel and probably too small to read code
  • Right clicking to paste something in the search sidebar view and then clicking a search result entry will also shift the focus and open the document in the wrong pane
  • When clicking the title bar menu entry, the entry suddenly shifts away underneath the cursor to the webview panel, which is very disorientating

Original report at leanprover/vscode-lean4#438.

Potentially related issue: #210108

@Marcin-Malek
Copy link

@mjbvz I would like to try fixing this bug. I know this issue has not made to "Good first issue" list, but this affects my extension which uses webview. I feel like i can manage this. Is there any chance that i could collaborate on this issue? If yes, should i sign a Contributor License Agreement?

@mjbvz mjbvz added bug Issue identified by VS Code Team member as probable bug webview Webview issues labels Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug webview Webview issues
Projects
None yet
Development

No branches or pull requests

3 participants