microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
160.77k stars 28.18k forks source link

Focus is shifting to webview panel on invoking context menu from tree view node (i.e right click on any treeview node/file from vscode explorer) #215547

Open ajaygera opened 1 month ago

ajaygera commented 1 month ago

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

Steps to Reproduce:

-In my extension, I created WebView and displayed that at the bottom of active text editor. -But whenever, I right click on any tree view node inside vscode Explorer ( launched from View -> Explorer) then WebView gets the focus. -Any action to launch context menu from tree view node should not shift the focus to Webview. -Please note, this issue started to appear from vscode version 1.88.1. -Also please note , this issue of shifting focus to webview does not occur when I display webview to the right of active text editor i.e. by executing command vscode.commands.executeCommand (workbench.action.moveEditorToRightGroup)

Below are vscode api, I used to create webview and display webview to bottom of active text editor 1) I have created webview using below vscode API vscode.window.createWebviewPanel( "resultWindow", "myView', vscode.ViewColumn.Active, { enableScripts: true, retainContextWhenHidden: true, } );

2)I have moved webview down to active text editor by executing below vscode command vscode.commands.executeCommand('workbench.action.moveEditorToBelowGroup');

In the attached video 1) I have webview with title Results:untitled -1 which is dispalyed below text editor which has some text - select * from TABLE22 2) webview does not have focus 3) When I right clicked on any node in vscode explorer then webview gets the focus. Issue - Focus should not shift to webview when we right clicked on node/file in vscode explorer

https://github.com/microsoft/vscode/assets/31886168/ecce870e-e34c-44db-93c6-ee3db065f786

ajaygera commented 4 weeks ago

Can you please help us to get this issue fixed? This issue is critical for our vscode extension and many of our customers looking forward for the fix because some of features in our vscode extension stopped working when our customers migrated to vscode version later than 1.88.1