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

Create WebView Panel with custom size and position in vscode API #103828

Closed
AZbang opened this issue Aug 3, 2020 · 3 comments
Closed

Create WebView Panel with custom size and position in vscode API #103828

AZbang opened this issue Aug 3, 2020 · 3 comments
Assignees
Labels
api feature-request Request for new features or functionality *out-of-scope Posted issue is not in scope of VS Code webview Webview issues
Milestone

Comments

@AZbang
Copy link

AZbang commented Aug 3, 2020

Now, when creating a new webview panel, I can specify the viewColumn, but I cannot specify which side and with what fixed size I want to open this panel.

For example, I want to open a panel from the bottom with a fixed height of 400px. For this I would like to do something like this:

vscode.window.createWebviewPanel(
      'webview', 'Webview',
      vscode.ViewColumn.Custom, // for custom column
      {
        viewPosition: vscode.ViewPosition.Bottom, // Up, Left, Right,
        viewSize: 400 // Fixed size for resizable side (for up and bottom it height, for left and right -- width),
        viewSize: 1/4 // Or maybe I want create panel with 25% size from available space for panels
      }
);
@mjbvz mjbvz added api webview Webview issues feature-request Request for new features or functionality labels Aug 3, 2020
@mjbvz
Copy link
Collaborator

mjbvz commented Sep 28, 2020

We don't give extension direct control over editor sizing and don't plan on adding this specifically for webviews (although, if we ever expose an API for controlling editor size, webview would should support it)

Webview views are often the better fit for cases where you'd want a specific sized webview

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api feature-request Request for new features or functionality *out-of-scope Posted issue is not in scope of VS Code webview Webview issues
Projects
None yet
Development

No branches or pull requests

3 participants
@mjbvz @AZbang and others