actions_popover: Fix copy link not working on enter keypress.

This commit is contained in:
Aman Agrawal
2023-11-06 15:57:46 +00:00
committed by Tim Abbott
parent 4dfb04d501
commit ebd0dcd5d2
2 changed files with 5 additions and 1 deletions

View File

@@ -41,6 +41,10 @@ export function popover_items_handle_keyboard(key, $items) {
let index = $items.index($items.filter(":focus"));
if (key === "enter" && index >= 0 && index < $items.length) {
// This is not enough for some elements which need to trigger
// natural click for them to work like ClipboardJS and follow
// the link for anchor tags. For those elements, we need to
// use `.navigate-link-on-enter` class on them.
$items.eq(index).trigger("click");
return;
}

View File

@@ -110,7 +110,7 @@
{{/if}}
<li>
<a class="copy_link" data-message-id="{{message_id}}" data-clipboard-text="{{ conversation_time_url }}" tabindex="0">
<a class="copy_link navigate-link-on-enter" data-message-id="{{message_id}}" data-clipboard-text="{{ conversation_time_url }}" tabindex="0">
<i class="fa fa-link" aria-hidden="true"></i> {{t "Copy link to message" }}
</a>
</li>