Fork me on GitHub
#keechma
<
2017-06-02
>
urbank14:06:34

>I’ve noticed that calling reagent/flush after you store the input in the atom usually solves the issue Where would you call this in keechma, if the input is controlled directly by the global state? I tried calling it in the dispatcher after app-db-atom is swapped, but it doesn't seem to work

mihaelkonjevic14:06:24

hm, I think that should work

mihaelkonjevic14:06:59

can you copy / paste that part of code?

urbank14:06:52

@mihaelkonjevic Not quite sure what part of the code to paste... ok here goes

urbank14:06:42

hm... let me come up with a minimal example

mihaelkonjevic14:06:00

there’s another thing that might be causing this, are you sure that the input element is not being re-created every time you update the value? Easiest way to determine this is to add some style through the dev tools and change the value

urbank14:06:54

Nope, the style persists

mihaelkonjevic14:06:00

ok, that’s good

mihaelkonjevic14:06:09

this code looks like it should work

mihaelkonjevic14:06:22

that’s interesting

mihaelkonjevic14:06:04

I’m trying to create a test project for this, how does your project.clj file look like?

urbank14:06:39

my project.clj has a bit of an identity crisis as far as names. Here:

mihaelkonjevic15:06:22

@urbank I definitely see this behavior, working on it

mihaelkonjevic15:06:43

@urbank so, the way I got it to work correctly is by passing the :input prop to semantic ui component (it’s supported by SemanticUI)

mihaelkonjevic15:06:28

you don’t need reagent/flush with that

urbank15:06:12

Yup that seems to work. Relatively elegant as well. Thanks for taking the time! Any idea why reagent/flush wouldn't work in the updater function?

mihaelkonjevic15:06:36

I think it has something to do with the fact that the semantic ui input is wrapped with an outer div which is in React land, instead of reagent land, so reagent probably can’t force re-render. That’s just a guess though