Skip to content

Height not refreshed after remove_childre #6205

@lyovushka

Description

@lyovushka

Have you checked closed issues? Yes

Have you checked against the most recent version of Textual? Yes

The bug

Here as an example to reproduce.

from textual.app import App, ComposeResult
from textual.containers import VerticalGroup
from textual.widgets import Static
from textual.binding import Binding


class ExampleApp(App):
    BINDINGS = [Binding("c", "clear", priority=True)]

    def compose(self) -> ComposeResult:
        yield Static("Hello")
        with VerticalGroup():
            for i in range(10):
                yield Static(str(i))
        yield Static("World")

    async def action_clear(self) -> None:
        vs = self.query_one(VerticalGroup)
        await vs.remove_children()


if __name__ == "__main__":
    app = ExampleApp()
    app.run()

After pressing "c" the children of VerticalGroup are removed but it is not being shrunk. The issue seems to first appear in textual==6.3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions