-
Notifications
You must be signed in to change notification settings - Fork 815
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
When fr dimensions have a min or max, they should yield their space to flexible units #2378
Comments
from textual.app import App, ComposeResult
from textual.containers import Horizontal, Vertical, VerticalScroll
from textual.widgets import Header, Footer, Static
class ScreenSplitApp(App[None]):
CSS = """
Horizontal {
width: 1fr;
}
Vertical {
width: 1fr;
background: blue;
min-width: 20;
}
VerticalScroll {
width: 3fr;
background: $panel;
}
Static {
width: 1fr;
content-align: center middle;
}
"""
def compose(self) -> ComposeResult:
yield Header()
with Horizontal():
yield Vertical()
with VerticalScroll():
for n in range(500):
yield Static(f"This is content number {n}")
yield Footer()
if __name__ == "__main__":
ScreenSplitApp().run() |
What appears to be happening is that when a @davep In the meantime, I think you should dock the sidebar to a fixed width. |
willmcgugan
changed the title
Unexpected
When fr dimensions have a min or max, they should yield their space to flexible units
Apr 26, 2023
VerticalScroll
scrollbar loss when adjacent to a min-width
container
davep
added a commit
to davep/textual-sandbox
that referenced
this issue
Apr 26, 2023
davep
added a commit
to Textualize/frogmouth
that referenced
this issue
Apr 26, 2023
See #5. This also works around Textualize/textual#2378
Don't forget to star the repository! Follow @textualizeio for Textual updates. |
talblubClouby96
added a commit
to talblubClouby96/frogmouth
that referenced
this issue
Aug 2, 2024
See #5. This also works around Textualize/textual#2378
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There might be other combinations that result in this, but this is a minimal version of the problem that has been observed in the markdown viewer. Consider this code:
When the terminal is wide enough that the
min-width
on theVertical
isn't activated, theVerticalScroll
has its scrollbar and works as would be expected:However, if the terminal is narrowed enough that the
min-width
kicks in on theVertical
on the left, theVerticalScroll
on the right drops its scrollbar (or perhaps retains it but it's off the screen) and the content starts to get cropped.The text was updated successfully, but these errors were encountered: