Skip to content

ModalScreen dock to right, two vertical scroll bars will appear. #6613

Description

@vegaoqiang

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

Image

ModalScreen on the left

Image

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.

Image

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                 |

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions