You have to make sure React doesn't touch the elements after Modal dialog
codes it job.

Use the similar technique as is shown in the highcharts cookbook entry:

https://github.com/reagent-project/reagent-cookbook/blob/master/recipes/highcharts/README.md

(You may consider if it's a good idea to have other tools ready to rebuild
the DOM, instead of generating the nescessary codw through reagent
directly, but it's doable, and sometimes a good way forward).

/Linus
Den 6 apr. 2016 05:56 skrev "Fernando Abrao" <fdab...@gmail.com>:

> Hello All,
>
> I´m trying to use Reagent with Sematic-UI Modal but I´m getting error in
> dialog button event. Code below.
>
> The open dialog is ok, but When I click to button "OK - Fechar" it´s
> getting the error:
> "Uncaught Error: Invariant Violation: findComponentRoot(..., .6.0.0.2.0):
> Unable to find element. This probably means the DOM was unexpectedly
> mutated (e.g., by the browser), usually due to forgetting a <tbody> when
> using tables, nesting tags like <form>, <p>, or <a>, or using non-SVG
> elements in an <svg> parent. Try inspecting the child nodes of the element
> with React ID ``."
> What I´ve missing?
>
> <code>
> (def jquery (js* "$"))
>
> (defn mostra-dialogo [id]
>   (let [dialogo (jquery id)]
>     (.modal dialogo "show")))
>
> (defn esconde-dialogo [id]
>   (let [dialogo (jquery id)]
>     (.modal dialogo "hide")))
>
> (defn dialogo []
>   [:div {:class "ui united small modal" :id "dialogo"}
>    [:div {:class "header"} "MODAL"]
>    [:div {:class "content"} "AHAHAHAHHA"]
>    [:div {:class "actions"}
>     [:button {:class "ui blue labeled button" :id "btSair"
>               :on-click (fn [e] (js/console.log "NO !!!"))} "OK - Fechar"]
>    ]])
>
> (defn home-page []
>   [:div
>    [dialogo]
>    [:div {:class "ui primary button" :id "btAbrir"
>           :on-click (fn [e] (mostra-dialogo "#dialogo"))} "Modal"]])
>
> (defn current-page []
>   [:div [(session/get :current-page)]])
>
> ;; -------------------------
> ;; Routes
>
> (secretary/defroute "/" []
>   (session/put! :current-page #'home-page))
>
> ;; -------------------------
> ;; Initialize app
>
> (defn mount-root []
>   (reagent/render [current-page] (.getElementById js/document "app")))
>
> (defn init! []
>   (accountant/configure-navigation!
>     {:nav-handler
>      (fn [path]
>        (secretary/dispatch! path))
>      :path-exists?
>      (fn [path]
>        (secretary/locate-route path))})
>   (accountant/dispatch-current!)
>   (mount-root))
> </code>
>
> --
> 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 clojurescript+unsubscr...@googlegroups.com.
> To post to this group, send email to clojurescript@googlegroups.com.
> Visit this group at https://groups.google.com/group/clojurescript.
>

-- 
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 clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.

Reply via email to