Fork me on GitHub
#reagent
<
2015-09-04
>
wqhhust01:09:18

@gadfly361 thanks for your help. I fixed the issue: for the select element, I used on-click event, after read the react doc, I changed it to use on-change event. then it works on both PC and mobile. I am using a physical phone & physical tablet. Just wondering why on-click works on PC but not on mobile.

benzen01:09:48

I,m having issue with what reframe call a form 2 component

benzen01:09:40

I want to call functions when the internal state has precise value

benzen01:09:59

I'm using a cond

benzen01:09:19

the :else expression is called

benzen01:09:40

the internal state is update

benzen01:09:50

but the component isn't re-rendered

benzen01:09:29

what i'm doing wrong

mikethompson01:09:49

We'll probably need to see a minimal example of code

mikethompson01:09:06

version 0.5.1.rc2 about to be released. Please test it on your apps.

mikethompson01:09:36

<!channel>: ^^^^

gary01:09:41

Okay 😄

voidlily02:09:09

please don't use at-channel, it notifies almost 200 people

timgilbert02:09:11

@mikethompson: just curious, got a changelog for 1.5.1? Didn’t see it on github

timgilbert02:09:05

I’m excited about the [:input] cursor stuff, have been shamelessly aping the implementation inside re-com without really understanding it 😐

mikethompson03:09:41

@voidlily: this is the reagent channel

mikethompson03:09:25

I actually did want to notify 200 people about the need to test 0.5.1.rc2

mikethompson03:09:04

@timgilbert: that's good that you've been testing it. I came up with the solution, but it actually isn't something we use very much. So your further testing is good.

mikethompson03:09:34

@timgilbert: Personally, I'm most excitted about the better error reporting (the "path" to the component will now be given when an error occurs in rendering)

mikethompson03:09:50

We'll fold that change into re-com at the very first oportunity

gadfly36106:09:18

@wqhhust awesome! Glad you found a working solution

benzen12:09:06

@mikethompson: I finally find what happend. The issue was that i was updating the local state, then on the following render i was taking it into account

benzen12:09:28

I'll make a gist to make it more clear

benzen12:09:24

@mikethompson: maybe it's a kind of error that we could add the rookies mistake section of the wiki of reframe

benzen12:09:59

if so, tell me and I'll be happy to trim my example to make it more easy to grasp

mikethompson13:09:10

There's a fair bit of code in that Gist. I'm not clear on the problem.

benzen14:09:42

Ok, so I'll trim it later today and post a new version

curtosis14:09:32

in reagent-forms, can I set a field attribute (e.g., rows for a textarea) based on a key in the ratom?

curtosis14:09:15

more generally, I suppose the question is: as I understand it, bind-fields uses the field :id value to pick out a key from the ratom... is there a way to do that more generally for attributes

curtosis14:09:14

my events-fn passed to bind-fields is catching the events and updating the state correctly, I'm just not successfully using that value.

benzen14:09:40

@mikethompson: I've updated the not-example part https://gist.github.com/benzen/dac5018371fd124fa3c7, do you think it's enought ?

mikethompson14:09:08

You say "this won't work" but I don't know what problem I'm looking at

mikethompson14:09:27

I guess I could puzzle over this for 10 mins and figure out what the intent is, and then what the problem might be. But most readers won;t have the time -- you really have to spoon feed people (like me ... I'm lazy)

mikethompson22:09:18

@benzen: To be an example of a rookie mistake, it has to be so simple that a rookie can understand it. That means it has to be about 5 lines code long and hit you between the eyes. I can see various puzzling things in that code, but it is all waaay too much, and to be honest I'm still not exactly sure of the specific point you are trying to highlight. If I don't immediately get it, a rookie won't.

darwin22:09:03

@benzen what are (on-right) (on-left) calls trying to achieve in the first example? don’t they cause re-rendeing? also swap on L29 looks suspicious. Component should not change its state during render call. It can do that in response to events, but should not do it during rendering itself.