Bug? onAfterDateSelect from daterange doesn't propagate to daterangepicker

I’m calling this.callEvent("onAfterDateSelect", range); in a cutom datepicker component, and I expect the date picker’s range to be updated. However, nothing happens, and I had to resort to a cumbersome call to do that, $$(this.getTopParentView().config.master).setValue(range);.

Is this a known issue? Should I call this.callEvent differently?

Hello,

Events are usually not used to change UI state, instead, they signify that something has happened with the widget.

As to the DaterangePicker, you just need to change the order of actions: firstly, set master (input) value - either directly or with an event - then apply the same to the Daterange itself.

Also, please mind the .callEvent syntax: parameters need to be enclosed into an array.

Please check the updated snippet (Last day): https://snippet.webix.com/jcaapsig