Replies: 2 comments 6 replies
-
I could reproduce it, but looking into the code, couldnt find anything that looks odd (besides the absense of I remember I had some issues with the custom hidden class which sets I also cloned netbook and tried it with the |
Beta Was this translation helpful? Give feedback.
-
FWIW, I quickly tried creating an MRE but can't reproduce this. Perhaps this simple example will help clarify what else your app might be doing to cause this rendering issue. I'm afraid your code is too complex to expect anyone to help debug this for you, so this really does needs a MRE. Have you tried checking the changes in Textual v6.0.0 in case that sheds some light? There's nothing that jumps out to me, but obviously you're more familiar with your code! import random
from textual import on
from textual.app import App, ComposeResult
from textual.containers import HorizontalGroup, VerticalScroll
from textual.message import Message
from textual.widgets import Checkbox, Input
class ExampleFind(HorizontalGroup):
BINDINGS = [("escape", "dismiss")]
DEFAULT_CSS = """
ExampleFind {
border-top: tall $accent;
padding: 0 1 1 1;
display: none;
Input { width: 1fr; }
}
"""
class Submitted(Message):
def __init__(self) -> None:
super().__init__()
def compose(self) -> ComposeResult:
yield Input(placeholder="Find")
yield Checkbox("Match case")
yield Checkbox("Whole word")
def on_input_submitted(self, event: Input.Submitted) -> None:
event.stop()
self.post_message(self.Submitted())
def action_dismiss(self) -> None:
self.display = False
class ExampleApp(App):
BINDINGS = [("ctrl+f", "find")]
def compose(self) -> ComposeResult:
with VerticalScroll(id="inputs-scroll"):
for i in range(100):
yield Input(placeholder=str(i))
yield ExampleFind()
@on(ExampleFind.Submitted)
def on_find_submitted(self) -> None:
# Scroll to a random input widget
inputs_scroll = self.query_one("#inputs-scroll", VerticalScroll)
all_inputs = inputs_scroll.query(Input)
random_input = random.choice(all_inputs)
inputs_scroll.scroll_to_widget(random_input)
def action_find(self) -> None:
find = self.query_one(ExampleFind)
find.display = True
find_input = find.query_one(Input)
find_input.focus()
if __name__ == "__main__":
app = ExampleApp()
app.run() |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I tried to upgrade to latest textual (v6.3.0) in netbook, but I got an issue with redrawing that seems to have appeared in v6.0.0. It is triggered by the search functionality. Although I am able to reproduce it quite consistently, the trigger conditions are a bit involved.
I have a demo below. Essentially after I scroll the main container back and forth and hide the search widget (triggered by pressing escape) the main container is not properly redrawn. The scrolling part is important as the problem isn't triggered without it.
Screencast.From.2025-10-13.21-21-45.mp4
I am still trying to come up with a minimal example, but maybe this would ring some bells as to what the problem might be.
Edit: I was able to modify @TomJGooding 's example to reproduce the issue. It seems to be caused by a combination of scrolling and setting focus to another widget before hiding the search widget. To reproduce: press ctrl+f, type some keys, then press escape. It doesn't happen all the time, but happens consistently enough.
Beta Was this translation helpful? Give feedback.
All reactions