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

How to have PanelViews fill the Panels? #538

Open
rrousselGit opened this issue Jan 25, 2024 · 0 comments
Open

How to have PanelViews fill the Panels? #538

rrousselGit opened this issue Jan 25, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@rrousselGit
Copy link

Feature request

It appears that panels are missing a way for their views to fill the space available.

Even though they use CSS grids, views are wrapped in this div.tabpanel hidden in the shadow-root that causes PanelViews to vertically fit their content.

Expected behavior

It would be great to have a way to make the following layout:

Screenshot 2024-01-25 at 13 26 53

Where the (React) code would be:

<VSCodePanels>
  <VSCodePanelTab>VARIABLES</VSCodePanelTab>
  <VSCodePanelTab>AUTHENTICATION</VSCodePanelTab>
  <VSCodePanelView>
    <div style={{backgroundColor: red}}>hello</div>
  </VSCodePanelView>
  <VSCodePanelView> ...  </VSCodePanelView>
</VSCodePanels>

Alternatively, maybe support for grid properties such as align-self would be nice.
For example the div.tabpanel could be a grid too.

Current behavior

Currently, the code given above ends-up with the following layout:

Screenshot 2024-01-25 at 13 34 31

And as far as I know, there are no easy way to change this.

I managed to find some tricks in React, by obtaining the HTML Element (using useRef) ; followed by editing the shadow-root by hand.
But that is fairly hacky and probably undesired.

Use case

I want the content of a PanelView to be scrollable.
But without having the PanelView fill the available space, scrolling instead causes the PanelTabs to go out of view.

@rrousselGit rrousselGit added the enhancement New feature or request label Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant