Giter Site home page Giter Site logo

Comments (7)

darrenburns avatar darrenburns commented on August 15, 2024

I was calling self.recompose inside on_resize inside the Screen I was pushing. This fails if there's a notification on screen as the first resize event arrives too early. I just put a block in to prevent it running on the first resize event and it works as expect.

from textual.

willmcgugan avatar willmcgugan commented on August 15, 2024

I suspect that is down to the call to self.app._refresh_notifications() in on_screen_resume. If that was awaited, it could fix it.

Could you try for an MRE again? I suspect it will be a matter of just repeating things very fast.

from textual.

darrenburns avatar darrenburns commented on August 15, 2024

Press n and then p:

from textual.app import App, ComposeResult
from textual.binding import Binding
from textual.screen import ModalScreen
from textual.widgets import Footer, Label


class MyScreen(ModalScreen[None]):
    def compose(self) -> ComposeResult:
        yield Label("MyScreen")

    async def on_resize(self) -> None:
        await self.recompose()


class MountCrash(App[None]):
    BINDINGS = [
        Binding("p", "push", "Push a new screen"),
        Binding("n", "notification", "Notification"),
    ]

    def compose(self) -> ComposeResult:
        yield Label("App")
        yield Footer()

    def action_notification(self) -> None:
        self.notify("Hello, world!", title="Notification message", timeout=10)

    async def action_push(self) -> None:
        await self.push_screen(MyScreen(), callback=lambda _: None)


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

from textual.

mzebrak avatar mzebrak commented on August 15, 2024

I think that's related to: #4570 (see the last MRE of my last response - it also happens on screen change, but pop_screen in my case)

from textual.

github-actions avatar github-actions commented on August 15, 2024

Don't forget to star the repository!

Follow @textualizeio for Textual updates.

from textual.

mzebrak avatar mzebrak commented on August 15, 2024

Unfortunately, the latest change in locks seems does not fix any of my issues mentioned in the linked (closed) issue #4570.

Could I ask you @darrenburns to take a look at this, please? Maybe you'll notice something right away, and I have some problems shown there (in MREs), like this mounting error and even the application freeze.

from textual.

willmcgugan avatar willmcgugan commented on August 15, 2024

Please do not comment on closed issues. We need an open issue to track tasks.

There's no need to mention any particular dev.

from textual.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.