It's easier to go the other way around and prevent propagation to the parent 
when the child is clicked:

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

On Sunday, September 14, 2014 1:15:58 PM UTC-4, Matt Ho 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?

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/clojurescript.

Reply via email to