Fork me on GitHub
#fulcro
<
2023-04-29
>
dvliman01:04:59

Hi, learning fulcro - I am running into issue rendering :enum field. Took a while to realize it needs qualified keys

(def sizes {:pet.size/:small "Small" :pet.size/:medium "Medium" :pet.size/:large "Large"})

(defattr size :pet/size :enum
  {ao/enumerated-labels sizes
   ao/enumerated-values (set (keys sizes))
   ao/identities #{:pet/id}
   ao/schema :production})
I debugged enumerated-field/render-to-one all the way before it calls https://github.com/fulcrologic/fulcro-rad-semantic-ui/blob/main/src/main/com/fulcrologic/rad/rendering/semantic_ui/enumerated_field.cljc#L73, value here is nil. Not sure what it should be This is the stacktrace I am getting:
act_devtools_backend_compact.js:2367 The above error occurred in the <input> component:
    in input (created by DropdownSearchInput)
    in DropdownSearchInput (created by Dropdown)
    in RefFindNode (created by Ref)
    in Ref (created by Dropdown)
    in div (created by Dropdown)
    in RefFindNode (created by Ref)
    in Ref (created by Dropdown)
    in Dropdown (created by com.fulcrologic.rad.rendering.semantic-ui.components/WrappedDropdown)
    in com.fulcrologic.rad.rendering.semantic-ui.components/WrappedDropdown (created by com.fulcrologic.rad.rendering.semantic-ui.form/StandardFormContainer)
    in div (created by com.fulcrologic.rad.rendering.semantic-ui.form/StandardFormContainer)
    in div (created by com.fulcrologic.rad.rendering.semantic-ui.form/StandardFormContainer)
    in div (created by com.fulcrologic.rad.rendering.semantic-ui.form/StandardFormContainer)
    in div (created by com.fulcrologic.rad.rendering.semantic-ui.form/StandardFormContainer)
    in com.fulcrologic.rad.rendering.semantic-ui.form/StandardFormContainer (created by app.ui.pet-forms/PetForm)
    in app.ui.pet-forms/PetForm (created by app.ui/MainRouter)
    in div (created by app.ui/MainRouter)
    in app.ui/MainRouter (created by app.ui/Root)
    in div (created by app.ui/Root)
    in app.ui/Root
Might be newbie mistake. I am following the https://github.com/fulcrologic/fulcro-rad-demo/blob/pathom3/src/shared/com/example/model/address.cljc#L77. Other fields are fine. Any idea? Thank you!

tony.kay06:04:03

You have extra : in your keywords...I don't know that it is your problem, but I don't see anything else strange

dvliman16:04:53

-        "react": "^16.9.0",
-        "react-dom": "^16.9.0",
-        "semantic-ui-react": "^0.88.1",
+        "react": "18.2.0",
+        "react-dom": "18.2.0",
+        "semantic-ui-react": "2.1.4",
Ah turns out it is because of the older version of javascript dependencies.