mirror of
https://github.com/zulip/zulip.git
synced 2025-11-14 02:48:00 +00:00
actions_popover: Fix copy link not working on enter keypress.
This commit is contained in:
@@ -41,6 +41,10 @@ export function popover_items_handle_keyboard(key, $items) {
|
|||||||
let index = $items.index($items.filter(":focus"));
|
let index = $items.index($items.filter(":focus"));
|
||||||
|
|
||||||
if (key === "enter" && index >= 0 && index < $items.length) {
|
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");
|
$items.eq(index).trigger("click");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -110,7 +110,7 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
<li>
|
<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" }}
|
<i class="fa fa-link" aria-hidden="true"></i> {{t "Copy link to message" }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
Reference in New Issue
Block a user