user_card_popover: Focus on menu options when opened with keyboard.

When the user card is opened via the keyboard shortcut `U`, the initial
focus should be on the first popover menu option, rather than the copy
buttons or the custom profile field links which can be distracting due
to the presence of tooltips on them.

Fixes part of #31027.
This commit is contained in:
Sayam Samal
2024-07-22 20:08:22 +05:30
committed by Tim Abbott
parent 99111a90d7
commit f124ef931d

View File

@@ -480,7 +480,9 @@ function get_user_card_popover_for_message_items() {
return undefined;
}
return $("li:not(.divider):visible a:not(.hide_copy_icon)", $popover);
// Return only the popover menu options that are visible, and not the
// copy buttons or the link items in the custom profile fields.
return $(".link-item .popover-menu-link", $popover).filter(":visible");
}
// Functions related to the user card popover in the user sidebar.