プロジェクト

全般

プロフィール

Vote #77201

完了

Issue id input should get focus after adding related issue

Admin Redmine さんが約4年前に追加. 約4年前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
UI_10
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
10
version_id:
140
issue_org_id:
22023
author_id:
145055
assigned_to_id:
332
comments:
5
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
70
ステータス-->[Closed]

説明

Current behavior when adding multiple related issues:

  • Click @Add@
  • @Issue #@ text input has focus
  • Enter issue number, press @Enter@ key
  • The add related issue subform stays open, but the @Issue #@ input has lost focus

To add another related issue, you must either:

  • Tab 5 times (to cycle through the @Add@ link, the link to the related issue, the @Delete relation@ link, the relation type drop-down, and then the @Issue #@ input). Then to add a third issue, you must tab 7 times. For a fourth, 9 times, and so on.
  • Move the mouse and re-click the text input.
  • Click @Add@ to close the subform and then @Add@ to reopen it, whereupon the @Issue #@ input receives focus.

The UI anticipates that you may need to enter multiple related issues as the subform stays open after each addition. Thus after a related issue is added the @Issue #@ input should retain focus.


journals

Ping
--------------------------------------------------------------------------------
This feature can be realized by the following small change.

<pre><code class="diff">
diff --git a/app/views/issue_relations/create.js.erb b/app/views/issue_relations/create.js.erb
index 0c2e036cc5..1f296e66d4 100644
--- a/app/views/issue_relations/create.js.erb
+++ b/app/views/issue_relations/create.js.erb
@@ -2,6 +2,6 @@ $('#relations').html('<%= escape_javascript(render :partial => 'issues/relations
<% if @relation.errors.empty? %>
$('#relation_delay').val('');
$('#relation_issue_to_id').val('');
- $('#relation_issue_to_id').focus();
<% end %>
$('#new-relation-form').show();
+$('#relation_issue_to_id').focus();
\ No newline at end of file
</code></pre>
--------------------------------------------------------------------------------
The patch posted by Mizuki works fine. Setting target version to 3.3.8.

The current code of Redmine sets focus to the text box in source:tags/3.4.5/app/views/issue_relations/create.js.erb#L5 but the focus will be cleared by @$('#new-relation-form').show();@ in source:tags/3.4.5/app/views/issue_relations/create.js.erb#L7.

The original code tries to set the focus only when no error occurs, but the proposed patch also sets the focus when an error occurs. I think the behavior of the patch is more natural.
--------------------------------------------------------------------------------
This bug seems to be introduced in r11610 (Redmine 2.4.0).
--------------------------------------------------------------------------------
Committed to the trunk and stable branches. Thank you all for reporting and fixing this issue.
--------------------------------------------------------------------------------

Admin Redmine さんが約4年前に更新

  • カテゴリUI_10 にセット
  • 対象バージョン3.3.8_140 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0