-
Notifications
You must be signed in to change notification settings - Fork 815
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Button Action Parameter Not Detecting In Correct Namespace #5394
Comments
This was changed way back in https://github.com/Textualize/textual/releases/tag/v0.61.0 to make it a requirement that the namespace is specified. I think that's just some outdated documentation. Changed in PR: #4516 |
I can create a PR adding a sentence specifying that a namespace is required if using the action parameter. |
The MRE for this example doesn't seem quite (See #5422). I wonder if that is relevant to this issue. |
So it says this here
But after running the provided MRE no action gets detected for the buttons. Although if I set the namespace explicitly the action still works.
textual/src/textual/widgets/_button.py
Lines 287 to 289 in 3f32592
My suspicion is that the above
default_namespace
parameter is the culprit, as its pointing to the incorrect parentScreen(id="_default")
, which doesn't contain the method. For example when I change it toself.app
, as a band aid fix it works correctly. In my opinion it should search up the DOM to the active screen, until an action actually matches or if no explicit screen is set it should check the main app class last instead of a screen.MRE
Textual Diagnostics
Versions
Python
Operating System
Terminal
Rich Console options
The text was updated successfully, but these errors were encountered: