Fork me on GitHub

@chrisjswanson I remember I'd the same problem when using semantic-ui-react with reagent and I fell back to bootstrap input.


Is there a specific reason why the key for a fulcro-form (`:fulcro.ui.forms/form`) is not prefixed with ui? So that it won't be passed to the remote?

Chris Swanson14:06:07

@hugh.jf.chen Yea, I was about to go that way too. As it turns out, I realized, I don't actually need to use a controlled input. If I just use "defaultValue" instead of "value", I can still keep the contents of the text field tied to the value in the app db. Because whenever a key is pressed I trigger a mutation of app db for the field, and the component's subscription will then cause a render. I still don't really understand why this works while a "true" controlled input has the cursor bug. But for anyone with the same situation, maybe just changing to use "defaultValue" will help.


@timovanderkamp Just trying to keep it from conflicting with other parameter names by using FQ namespace. You point about the remote it an oversight 😕


@tony.kay i noticed that the initialized form was removed after a second load, because the form key was queried but returned nil. Thats why I was asking. It can easily be prevented though by using the without load-paramater


@timovanderkamp Technically you should re-initialize the form after a load, since the "saved" pristine state is wrong


Ye that is also what i thought about after asking this question


Thanks for the clarification


whats going on here?

18 | (defsc Transaction [this {:keys [txn/amount]}]
{:cause #error {
 :cause "Invalid arguments"
 :data {:reason "[] is invalid."}
 [{:type clojure.lang.ExceptionInfo
   :message "Invalid arguments"
   :data {:reason "[] is invalid."}
   :at [clojure.core$ex_info invokeStatic "core.clj" 4739]}]


@afhammad what does the rest of your defsc look like? There's not enough in that error msg to tell



(defsc Transaction [this {:keys [txn/amount]}]
  { :query [:txn/id :txn/amount]
    :initial-state (fn [params] {:txn/id (:id params) :txn/amount (:amount params)})
    :ident [:txn/by-id]}
    (dom/div txn/amount)))


my first go at fulcro, and haven’t touched clojure in a while, please point out if anything looks silly


@chrisjswanson I had opened a report to semantic-ui-react but they think the component works expected and close my report immediately


@afhammad looks like the :ident should be :ident [:txn/by-id :txn/id]