diff --git a/lazy_github/ui/screens/new_issue.py b/lazy_github/ui/screens/new_issue.py index c48754d..6bf4bc6 100644 --- a/lazy_github/ui/screens/new_issue.py +++ b/lazy_github/ui/screens/new_issue.py @@ -13,6 +13,8 @@ class NewIssueContainer(Container): + BINDINGS = [LazyGithubBindings.SUBMIT_DIALOG] + DEFAULT_CSS = """ #button_holder { align: center middle; @@ -50,8 +52,7 @@ def compose(self) -> ComposeResult: def cancel_new_issue(self, _: Button) -> None: self.app.pop_screen() - @on(Button.Pressed, "#save_new_issue") - async def submit_new_issue(self, _: Button) -> None: + async def create_issue(self) -> None: assert LazyGithubContext.current_repo is not None, "Unexpectedly missing current repo from application context!" title = self.query_one("#new_issue_title", Input).value @@ -68,6 +69,13 @@ async def submit_new_issue(self, _: Button) -> None: self.notify(f"Successfully created issue #{new_issue.number}") self.post_message(IssueCreated(new_issue)) + async def action_submit(self) -> None: + await self.create_issue() + + @on(Button.Pressed, "#save_new_issue") + async def handle_save_new_issue_button(self, _: Button) -> None: + await self.create_issue() + class NewIssueModal(ModalScreen[Issue | None]): BINDINGS = [LazyGithubBindings.CLOSE_DIALOG]