🐛 Fix close modal with esc (#11131)

This commit is contained in:
Eva Marco 2026-08-07 12:33:11 +02:00 committed by GitHub
parent a131e40a6d
commit bf9825fcfe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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)}