Skip to content

Commit 932e282

Browse files
Fix duplicate ID when deleting repo (#28520) (#28528)
Backport #28520 by @framitdavid There is an accessibility issue in the interface when attempting to delete a repository. When I click on "Delete repository," a dialog box appears, requiring confirmation to proceed with the repository deletion. However, when I press the "Repo name" label, the wrong input field gains focus. The focused field is located behind the dialog and is intended for renaming the repository. I am submitting these pull requests to ensure that the correct input field is focused when the user clicks on the label. This change will also facilitate the writing of tests using Playwright or Testing Library to retrieve elements based on roles. This PR will also improve acessibility of this area. Co-authored-by: David Øvrelid <[email protected]>
1 parent d9aeb1f commit 932e282

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

templates/repo/migrate/migrating.tmpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@
7373
</label>
7474
</div>
7575
<div class="required field">
76-
<label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label>
77-
<input id="repo_name" name="repo_name" required>
76+
<label for="repo_name_to_delete">{{ctx.Locale.Tr "repo.repo_name"}}</label>
77+
<input id="repo_name_to_delete" name="repo_name" required>
7878
</div>
7979

8080
<div class="text right actions">

templates/repo/settings/options.tmpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -921,8 +921,8 @@
921921
</label>
922922
</div>
923923
<div class="required field">
924-
<label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label>
925-
<input id="repo_name" name="repo_name" required>
924+
<label for="repo_name_to_delete">{{ctx.Locale.Tr "repo.repo_name"}}</label>
925+
<input id="repo_name_to_delete" name="repo_name" required>
926926
</div>
927927

928928
<div class="text right actions">

0 commit comments

Comments
 (0)