From bf9825fcfe579c5966f1f6e61766928faf7d278a Mon Sep 17 00:00:00 2001 From: Eva Marco Date: Fri, 7 Aug 2026 12:33:11 +0200 Subject: [PATCH] :bug: Fix close modal with esc (#11131) --- frontend/src/app/main/ui/comments.cljs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/frontend/src/app/main/ui/comments.cljs b/frontend/src/app/main/ui/comments.cljs index 4a7032b62c..550b4b8e37 100644 --- a/frontend/src/app/main/ui/comments.cljs +++ b/frontend/src/app/main/ui/comments.cljs @@ -1063,6 +1063,14 @@ (fn [content] (st/emit! (dcm/add-comment thread content)))) + on-key-down + (mf/use-fn + (fn [event] + (when (kbd/esc? event) + (dom/prevent-default event) + (dom/stop-propagation event) + (st/emit! (dcm/close-thread))))) + on-cancel (mf/use-fn #(st/emit! (dcm/close-thread)))] @@ -1086,6 +1094,7 @@ :style {:left (str pos-x "px") :top (str pos-y "px") "--comment-height" (str max-height "px")} + :on-key-down on-key-down :on-click dom/stop-propagation} [:div {:class (stl/css :floating-thread-header)}