DateRangePicker icon indicating copy to clipboard operation
DateRangePicker copied to clipboard

send actions on user input only

Open DivineDominion opened this issue 5 years ago • 3 comments

This is just a suggestion pertaining the target/action mechanism, not KVO and delegates: when you change the date programmatically, do not invoke the target/action pair. That's more in line with programmatic changes to AppKit components like NSTextField.

In my case, this does not result in fetching the initial data twice, but by default it would if you populate the view with something and then have data for the same range requested again.

DivineDominion avatar Nov 02 '19 06:11 DivineDominion

I see your point; I guess I just wanted to have to handle value changes in one place only. Feel free to file a PR adding an option to not send events upon programmatic changes.

MrMage avatar Nov 11 '19 13:11 MrMage

Will do! I would actually favor making this an opt-in, not sending event by default. But that'd be a breaking change, and you'd have to decide if that fits your plan. So do you want me to make it an opt-in or opt-out feature?

On 11. Nov 2019, at 14:15, Daniel Alm [email protected] wrote:

I see your point; I guess I just wanted to have to handle value changes in one place only. Feel free to file a PR adding an option to not send events upon programmatic changes.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

DivineDominion avatar Nov 11 '19 14:11 DivineDominion

I would suggest keeping the current behavior; for most people it probably won't make a difference anyway.

MrMage avatar Nov 11 '19 14:11 MrMage