Skip to content

Commit 328bb65

Browse files
committed
ensured first comment thread action is autofocused on modal open
1 parent b16948f commit 328bb65

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

app/assets/javascripts/comments.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,8 @@ $(() => {
179179
});
180180
});
181181

182+
QPixel.DOM?.watchClass('.js-thread-actions.is-active', (target) => target.querySelector('a')?.focus());
183+
182184
$(document).on('click', '.js--show-followers', async (evt) => {
183185
evt.preventDefault();
184186

app/views/comments/_thread_actions_modal.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
user : user to show the modal for
77
"%>
88

9-
<div class="droppanel js--tools-thread-<%= thread.id %>">
9+
<div class="droppanel js-thread-actions js--tools-thread-<%= thread.id %>">
1010
<div class="droppanel--header">thread options</div>
1111
<div class="droppanel--menu">
1212
<% if user.at_least_moderator? || !thread.read_only? %>

0 commit comments

Comments
 (0)