0

我有一个输入字段

[:input {:type "text"}]

我需要检测用户在编辑该字段时何时按下 Esc 键。我怎么做?

4

1 回答 1

1

向元素添加:on-key-up(或)处理程序::on-key-down

[:input {:type "text"
         :on-key-up #(when (= 27 (.-which %))
                       (do-something-here))}]
于 2016-03-27T03:22:47.453 回答