fix(widget): fix visual not updated after style changes#6367
Closed
TomJGooding wants to merge 1 commit intoTextualize:mainfrom
Closed
fix(widget): fix visual not updated after style changes#6367TomJGooding wants to merge 1 commit intoTextualize:mainfrom
TomJGooding wants to merge 1 commit intoTextualize:mainfrom
Conversation
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
Member
|
Thanks. Going with #6372 |
Collaborator
Author
|
@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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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