Fork me on GitHub
#reagent
<
2015-09-24
>
tel04:09:51

@colin.yates: what’s the bug there?

colin.yates08:09:04

Hi @tel - the problem is that the outer fn is called only once therefore the subscription is called only once. If the data you pass in changes then the subscription doesn’t. For example, if I have a subscription which incs the provided parameter and I call [my-cmp 1]. If I subsequently call [my-cmp 2] then I won’t get a new subscription and nothing will change. That’s the effect I am seeing anyway

tel13:09:14

that makes sense

tel13:09:03

and is indeed a subtle bug

tel13:09:18

or potential bug anyway

mbertheau17:09:07

Does reagent or react fiddle with the meta key in a way that if in the first run I create an element outside of a for loop with a certain key, it's not the same when in the next run I create the element in a for loop with the same key?

mbertheau17:09:29

The use case is that I have an empty input field, and as soon as something is typed into it a new one appears next to it. What happens is that the cursor moves to the new field, and data-reactid of the field from the two runs is different, even though the key is the same.

mbertheau17:09:23

Correction: currently the field loses focus, so the cursor is nowhere after entering the first character in the input.

mbertheau17:09:07

Indeed if I munge the code such that all elements originate from (for), it works.