Yep, that was it.  Thank you!

M


On Sunday, September 14, 2014 5:28:44 PM UTC-7, Sean Corfield wrote:
> 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?

-- 
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