Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Properties set in looped custom tag element event seem to be cleared by parent update #2019
Help us to manage our issues by answering the following:
Using custom tags is covered only very briefly in the guide (http://riotjs.com/guide/#looping-custom-tags) so I wouldn't be surprised if I'm doing something incorrectly here. It appears that a property updated in an element event in a looped tag is immediately cleared by a parent update. My assumption is that the child tag is having its properties entirely overridden by the loop item context on update.
The behavior of the very shortly lived input element on link click in the provided example should demonstrate the issue, and a debugger in the child tag update event will show its properties being cleared.
Am I going too far against the grain here by trying to keep state in a looped custom tag? I'm working on a larger application which has some looped elements that are fairly complex, and keeping their state in a parent tag is going to be hard to maintain.
There's also a secondary issue of
Reproduced on Chromium 53/Linux, FF 49/Linux, FF 47/Windows
Reproduced on 2.6.3 and master
Thank you all for the review/sanity check.
Both issues appear to be corrected on
@corps Thank you very much for the suggested workaround. I've had a few issues with