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

One webview, two displays, both broken #44585

Closed
jrieken opened this issue Feb 27, 2018 · 1 comment
Closed

One webview, two displays, both broken #44585

jrieken opened this issue Feb 27, 2018 · 1 comment
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded webview Webview issues
Milestone

Comments

@jrieken
Copy link
Member

jrieken commented Feb 27, 2018

re #44466

  • have the snippet below
  • invoke the command, you'll have two webviews in column 1 and 2, both are kind of broken
export function activate(context: vscode.ExtensionContext) {

    // Use the console to output diagnostic information (console.log) and errors (console.error)
    // This line of code will only be executed once when your extension is activated
    console.log('Congratulations, your extension "webview" is now active!');

    const webview = vscode.window.createWebview(vscode.Uri.parse('foo:bar/bazz'), vscode.ViewColumn.One, {});
    
    // The command has been defined in the package.json file
    // Now provide the implementation of the command with  registerCommand
    // The commandId parameter must match the command field in package.json
    let disposable = vscode.commands.registerCommand('extension.sayHello', () => {
        // The code you place here will be executed every time your command is executed
        
        webview.title = 'webview';    
        webview.html = '<h1 id="fff">Test</h1><script>document.getElementById("fff").innerHTML += Math.random();</script>';
        webview.show(vscode.ViewColumn.Three);
        // Display a message box to the user
        // vscode.window.showInformationMessage('Hello World!');
    });

    context.subscriptions.push(disposable);
}
@jrieken jrieken assigned mjbvz and unassigned jrieken Feb 27, 2018
@mjbvz mjbvz added bug Issue identified by VS Code Team member as probable bug webview Webview issues labels Feb 27, 2018
@mjbvz
Copy link
Collaborator

mjbvz commented Feb 27, 2018

Yes the intended design is that a webview should only exist in a single editor group at a time. show should close the editor in column one and move it to the second column. Not doing this currently

@mjbvz mjbvz added this to the February 2018 milestone Feb 28, 2018
@mjbvz mjbvz closed this as completed in a48c4d7 Feb 28, 2018
@jrieken jrieken added the verified Verification succeeded label Mar 1, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Apr 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded webview Webview issues
Projects
None yet
Development

No branches or pull requests

2 participants