Skip to content

Unable to dispatch a click event #23

@murtaza52

Description

@murtaza52

Hi,

I am trying to dispatch a click event on a button -

(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! (sel "#sign_in") "click" {}))))))

The listen! event works, I am even able to log messages from the when block , however the dispatch doesnt work. I am however able to trigger a click event using jquery from the browsers console.

Any help will be appreciated.

Thanks,
Murtaza

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions