Describe your issue:
I'm not sure if this is by design or a bug. Setting an observable event handler directly to the tag's update method - e.g. using obs.on('event', this.update) inside a tag - causes expression parsing to break when the event is triggered asynchronously (expressions incorrectly evaluate to null).
This only occurs in @next, and used to work fine in 2.x.
Can you reproduce the issue?
http://plnkr.co/edit/liZ9RHSgmvkwVynstegU?p=preview
@next:Switching this.opts.model.on('emit', this.update); to:
this.opts.model.on('emit', function(){
_this.update();
});
However, with this approach, we can no longer unregister the handler since it's an anonymous function. The obvious workaround is to make a separate method: eventHandler(){ _this.update() } but it seems like overkill for such a common use case.
setTimeout on line 20 of my-tag.html). edit: _Actually, this no longer works for me, not sure why._On which browser/OS does the issue appear?
Chrome / Windows 10 64-bit
Safari / iOS 10
Which version of Riot does it affect?
@next
How would you tag this issue?