mirror of
https://github.com/penpot/penpot.git
synced 2026-08-08 13:58:35 +00:00
🐛 Fix close modal with esc (#11131)
This commit is contained in:
parent
a131e40a6d
commit
bf9825fcfe
@ -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)}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user