Skip to content

Commit

Permalink
Focus filename input when duplicate name for new file
Browse files Browse the repository at this point in the history
  • Loading branch information
darrenburns committed Aug 11, 2024
1 parent 448321f commit a690e49
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/posting/widgets/collection/new_request_modal.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ def action_create_request(self) -> None:
self.create_request()

def create_request(self) -> None:
file_name = self.query_one("#file-name-input", Input).value
file_name_input = self.query_one("#file-name-input", Input)
file_name = file_name_input.value
directory = self.query_one("#directory-input", Input).value
description = self.query_one("#description-textarea", PostingTextArea).text

Expand Down Expand Up @@ -192,6 +193,7 @@ def create_request(self) -> None:
"A request with this name already exists.",
severity="error",
)
file_name_input.focus()
return
else:
continue
Expand Down

0 comments on commit a690e49

Please sign in to comment.