瀏覽代碼

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 <46874830+framitdavid@users.noreply.github.com>
tags/v1.21.3
Giteabot 5 月之前
父節點
當前提交
932e282e15
沒有連結到貢獻者的電子郵件帳戶。
共有 2 個檔案被更改,包括 4 行新增4 行删除
  1. 2
    2
      templates/repo/migrate/migrating.tmpl
  2. 2
    2
      templates/repo/settings/options.tmpl

+ 2
- 2
templates/repo/migrate/migrating.tmpl 查看文件

@@ -73,8 +73,8 @@
</label>
</div>
<div class="required field">
<label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label>
<input id="repo_name" name="repo_name" required>
<label for="repo_name_to_delete">{{ctx.Locale.Tr "repo.repo_name"}}</label>
<input id="repo_name_to_delete" name="repo_name" required>
</div>

<div class="text right actions">

+ 2
- 2
templates/repo/settings/options.tmpl 查看文件

@@ -921,8 +921,8 @@
</label>
</div>
<div class="required field">
<label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label>
<input id="repo_name" name="repo_name" required>
<label for="repo_name_to_delete">{{ctx.Locale.Tr "repo.repo_name"}}</label>
<input id="repo_name_to_delete" name="repo_name" required>
</div>

<div class="text right actions">

Loading…
取消
儲存