From 63200b9e9e28aa87810a7fc2205b4012d052cf43 Mon Sep 17 00:00:00 2001 From: Sayam Samal Date: Fri, 25 Jul 2025 10:58:52 +0530 Subject: [PATCH] left_sidebar: Fix ENTER key navigation in more conversations in DM list. This commit addresses the issue where pressing the ENTER key on the "more conversations" link in the direct messages list did not perform the intended action by adding a `trigger-click-on-enter` class to the element. This allows the `process_enter_key` function to explicitly trigger a click event on the element when the ENTER key is pressed, ensuring that the associated click handler is called. --- web/src/hotkey.js | 8 ++++++++ web/templates/more_pms.hbs | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/web/src/hotkey.js b/web/src/hotkey.js index 6c91f6b2af..6a052b48d7 100644 --- a/web/src/hotkey.js +++ b/web/src/hotkey.js @@ -560,6 +560,14 @@ function handle_popover_events(event_name) { // Returns true if we handled it, false if the browser should. export function process_enter_key(e) { + if ($(e.currentTarget).hasClass("trigger-click-on-enter")) { + // If the target has the class "trigger-click-on-enter", explicitly + // trigger a click event on it to call the associated click handler. + e.preventDefault(); + $(e.currentTarget).trigger("click"); + return true; + } + if (popovers.any_active() && $(e.target).hasClass("navigate-link-on-enter")) { // If a popover is open and we pressed Enter on a menu item, // call click directly on the item to navigate to the `href`. diff --git a/web/templates/more_pms.hbs b/web/templates/more_pms.hbs index 121d8a04b1..ba5ef46398 100644 --- a/web/templates/more_pms.hbs +++ b/web/templates/more_pms.hbs @@ -1,5 +1,5 @@
  • - {{t "more conversations" }} + {{t "more conversations" }} {{more_conversations_unread_count}}