popover_menus: Fix enter keypress not working on some popovers.

Fixed for message actions popover, stream popover, topic
popover and maybe others.
This commit is contained in:
Aman Agrawal 2023-10-03 16:25:04 +00:00 committed by Tim Abbott
parent f3465dea08
commit 6ef03498a9
1 changed files with 5 additions and 0 deletions

View File

@ -89,6 +89,11 @@ 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) {
$items.eq(index).trigger("click");
return;
}
if (index === -1) { if (index === -1) {
index = 0; index = 0;
} else if ((key === "down_arrow" || key === "vim_down") && index < $items.length - 1) { } else if ((key === "down_arrow" || key === "vim_down") && index < $items.length - 1) {