Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DatetimeSelector ValueChanged callback does not include PreviousValue #77

Open
OhHey-ItsDave opened this issue Apr 22, 2024 · 1 comment

Comments

@OhHey-ItsDave
Copy link

DatetimeSelector widget's protected methods: onDateEdited(), onTimeEdited(), and onTimeZoneChanged() do not include the previous value from the "evt" struct passed into them with the "evtOut" struct they then pass to the ValueChanged callback in App Designer.

Result is that the callback exposed within App Designer's Code View will always have "event.PreviousValue" equal "[ ]".

function onDateEdited(obj,evt)

@OhHey-ItsDave
Copy link
Author

Issue can be corrected by recording widget's current Value at the top of these functions, before edits are made.

newValue = evt.Source.Value; % Already present
previousValue = obj.Value; % Added previousValue variable

Then including the previousValue in evtOut

evtOut = wt.eventdata.ValueChangedData(obj.Value, previousValue); % Modified evtOut

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant