Skip to content

fix(widget): fix visual not updated after style changes#6367

Closed
TomJGooding wants to merge 1 commit intoTextualize:mainfrom
TomJGooding:fix-widget-visual-not-updating-after-style-changes
Closed

fix(widget): fix visual not updated after style changes#6367
TomJGooding wants to merge 1 commit intoTextualize:mainfrom
TomJGooding:fix-widget-visual-not-updating-after-style-changes

Conversation

@TomJGooding
Copy link
Collaborator

Fix a significant regression in Textual v6.0.0 where the widget visual is not updated after style changes.

This effectively reverts the changes in dca9439, which intended to optimize styles caching but clearly had unintended consequences.

Fixes #6235
Fixes #6289
Fixes #6322

Fix a significant regression in Textual v6.0.0 where the widget visual
is not updated after style changes.

This effectively reverts the changes in dca9439, which intended to
optimize styles caching but clearly had unintended consequences.

Fixes Textualize#6235
Fixes Textualize#6289
Fixes Textualize#6322
@TomJGooding TomJGooding marked this pull request as ready for review February 13, 2026 21:44
@willmcgugan
Copy link
Member

Thanks. Going with #6372

@TomJGooding
Copy link
Collaborator Author

TomJGooding commented Feb 15, 2026

@willmcgugan The fix in #6372 doesn't seem to account for the other issues related to the visual style?

For example, notice the label background isn't updated here:

from textual.app import App, ComposeResult
from textual.containers import CenterMiddle
from textual.widgets import Label, Select


class ExampleApp(App):
    def compose(self) -> ComposeResult:
        yield Select.from_values(["red", "green", "blue"])
        with CenterMiddle(id="color-container"):
            yield Label("Try changing the background color")

    def on_select_changed(self, event: Select.Changed):
        self.query_one("#color-container").styles.background = event.value


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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants