I have an input component that looks something like:

(defn handle-change! [e data edit-key owner]
  (if (= (type data) om/MapCursor)
    (om/update! data [edit-key] 
                (if (string? e) e (.. e -target -value)))))

(defn textarea [declaration owner {:keys [attribute] :as opts}]
  (reify
    om/IRender
    (render [_]
      (d/textarea {:value (attribute declaration)
                   :on-change #(handle-change! % declaration attribute 
owner)}))))

and state that looks something like:
{:attribute "text"
 :children {:child-key [{:ch-attr "text"}]}}

when I build the textarea with a cursor into the above state, it works just 
fine, but when I build it with a cursor into a member of the children vector 
(such as {:ch-attr "text"}), it throws an 
"Uncaught Error: Cannot manipulate cursor outside of render phase, only 
om.core/transact!, om.core/update!, and cljs.core/deref operations allowed" at 
the om/update! line.

if I do something like, set-state! in handle-change!, add state to the 
textarea, and update! the same cursor from within render-state, then it works

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