The bug
I'm using a VerticalScroll container in a ModalScreen. When I place this ModalScreen on the left side of the screen, everything looks normal. However, when I place it on the right side, what appears to be two vertical scrollbars appear on the right.
ModalScreen on the right
ModalScreen on the left
My Code
class DetailModal(ModalScreen):
DEFAULT_CSS = """
#detail {
width: 40%;
dock: right;
height: 1fr;
}
"""
def compose(self) -> ComposeResult:
with VerticalScroll(id="detail"):
.....
When I remove the dock style in the CSS and replace it with align: right top; It will also recur. I tried adding a gap between the DetailModal and the right border, and the scrollbar, which looked abnormal, disappeared.
Please ignore the blue rectangle on the right; it is part of the background.
<!-- This is valid Markdown, please paste the following directly in to a GitHub issue -->
# Textual Diagnostics
## Versions
| Name | Value |
|---------|--------|
| Textual | 8.2.7 |
| Rich | 15.0.0 |
## Python
| Name | Value |
|----------------|------------------------------------------------------|
| Version | 3.13.13 |
| Implementation | CPython |
| Compiler | Clang 16.0.0 (clang-1600.0.26.6) |
| Executable | /Users/gaoxiang/VscodeProjects/kop/.venv/bin/python3 |
## Operating System
| Name | Value |
|---------|--------------------------------------------------------------------------------------------------------|
| System | Darwin |
| Release | 25.5.0 |
| Version | Darwin Kernel Version 25.5.0: Mon Apr 27 20:41:15 PDT 2026; root:xnu-12377.121.6~2/RELEASE_ARM64_T6041 |
## Terminal
| Name | Value |
|----------------------|-------------------|
| Terminal Application | iTerm.app (3.6.8) |
| TERM | xterm-256color |
| COLORTERM | truecolor |
| FORCE_COLOR | *Not set* |
| NO_COLOR | *Not set* |
## Rich Console options
| Name | Value |
|----------------|----------------------|
| size | width=272, height=53 |
| legacy_windows | False |
| min_width | 1 |
| max_width | 272 |
| is_terminal | True |
| encoding | utf-8 |
| max_height | 53 |
| justify | None |
| overflow | None |
| no_wrap | False |
| highlight | None |
| markup | None |
| height | None |
The bug
I'm using a VerticalScroll container in a ModalScreen. When I place this ModalScreen on the left side of the screen, everything looks normal. However, when I place it on the right side, what appears to be two vertical scrollbars appear on the right.
ModalScreen on the right
ModalScreen on the left
My Code
When I remove the dock style in the CSS and replace it with
align: right top;It will also recur. I tried adding a gap between the DetailModal and the right border, and the scrollbar, which looked abnormal, disappeared.