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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/clojurescript.