I have an input field
[:input {:type "text"}]
and I need to detect when user presses an Esc key while editing that field. How do I do that?
I have an input field
[:input {:type "text"}]
and I need to detect when user presses an Esc key while editing that field. How do I do that?
Add an :on-key-up
(or :on-key-down
) handler to the element:
[:input {:type "text"
:on-key-up #(when (= 27 (.-which %))
(do-something-here))}]