Hi,
I am trying to trigger / dispatch click event on a button.
The following code works in the browser - $ ("button").trigger ("click")
However I am not able to trigger the same from my cljs code (I am using
domina) -
(defn enter-to-click
"It captures the enter event on the given element selector (s1) and
triggers a click event on the element selector (s2)"
[s1 s2]
(let [el1 (sel s1) el2 (sel s2)]
(listen! el1 :keydown (fn [ev]
(when (= (:keyCode ev) 13)
(dispatch! el2 :click {}))))))
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en