This is mainly for @eviltrout but would have implications to all plugin devs.
At the moment sendWidgetAction
and Event
is not binding this
to the widget.
sendWidgetAction(name, param) {
return this.rerenderResult(() => {
const widget = this._findAncestorWithProperty(name);
if (widget) {
return widget[name](param);
}
return this._sendComponentAction(name, param || this.findAncestorModel());
});
}
In particular we have
if (widget) {
return widget[name](param);
}
Instead this could be:
if (widget) {
return widget[name].call(widget, param);
}
Is there and reason we should not make this change?