I think your on-click handler needs to return false:

(defn content-view [content]
  [:div {:on-click (fn [e]
                     (println "inside clicked")
                     false)}
    (:content content)])

(this is the same in JS where your onClick attribute tends to be "doStuff(); 
return false;" in this situation)

Sean

On Sep 14, 2014, at 10:15 AM, Matt Ho <[email protected]> wrote:

> I'm new to reagent, but so far my experience with it has been fantastic.  
> Here's the issue I'm coming across.  I'm attempting to write a calendar cell 
> that represents a day.  Given the following snippets:
> 
> (defn content-view [content]
>  [:div {:on-click #(println "inside clicked")} (:content content)])
> 
> (defn contents-view [contents]
>  [:div (for [content contents]
>          [content-view content])])
> 
> (defn day-view [day]
>  [:td.day [:div.contents {:on-click #(println "outside clicked")}
>            [:div.content [contents-view (:contents day)]]]])
> 
> If I click on a content entry, both on-click events are called.  How do I 
> prevent on-click from falling through?

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

Reply via email to