We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In Elia, I have a few places where you click a link and it fires an action.
My action methods are usually located at the screen level.
On the latest version (0.63.1), all of my links are broken and have lookup failures which look like this in the logs:
[21:30:52] SYSTEM app.py:3146 <action> 'foo' has no target. Could not find methods '_action_foo' or 'action_foo'
In the latest version of Textual, I think actions are always being looked up on the App, regardless of the namespace used.
App
In the example app below, note that output is always The action fired on APP! - the action method on the screen never fires.
The action fired on APP!
from textual import __version__ from textual.app import App, ComposeResult from textual.screen import Screen from textual.widgets import Label class HomeScreen(Screen[None]): def compose(self) -> ComposeResult: yield Label(f"Textual version: {__version__}") yield Label("[@click=foo]Fire action (@click=foo)![/]") yield Label("[@click=app.foo]Fire action (@click=app.foo)![/]") yield Label("[@click=screen.foo]Fire action (@click=screen.foo)![/]") def action_foo(self) -> None: self.app.panic("The action fired on SCREEN!") class ActionNamespaceBug(App[None]): def get_default_screen(self) -> HomeScreen: return HomeScreen() def action_foo(self) -> None: self.app.panic("The action fired on APP!") if __name__ == "__main__": app = ActionNamespaceBug() app.run()
The text was updated successfully, but these errors were encountered:
Don't forget to star the repository!
Follow @textualizeio for Textual updates.
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
In Elia, I have a few places where you click a link and it fires an action.
My action methods are usually located at the screen level.
On the latest version (0.63.1), all of my links are broken and have lookup failures which look like this in the logs:
In the latest version of Textual, I think actions are always being looked up on the
App
, regardless of the namespace used.In the example app below, note that output is always
The action fired on APP!
- the action method on the screen never fires.The text was updated successfully, but these errors were encountered: