Skip to content

Conversation

@flowt-au
Copy link

@flowt-au flowt-au commented Jan 9, 2021

Again, I hope I am doing this PR correctly.

With the datetime mode, when you "set" the date and move to the time, the input value gets updated. If you then click Cancel, the changed date does not revert to the original one because the set on the date sets original to the new date (in onSetClick() ) so it has lost the original.

Also, in my app, I needed to know when the user did click Set and did click Cancel (or blurred away) because I am using your picker in a custom composite field with 2 datetime pickers. and needed to take definitive action.

So, I have made some suggestions via this PR to make all that work. I left comments in the code (QDatetimePicker.js) which you will see to explain my thinking.

For the issue of "undoing" the date even if the user has clicked Set on the date, I am listening for the cancel event in my app and reverting to my saved date property. This seems better than trying to come up with a way to do it within your datetime picker. And, I can imagine someone might want the current functionality. So, using a cancel event and letting the user handle the "undo" themselves seems like a better option.

Thanks again for your work,
Murray

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

Successfully merging this pull request may close these issues.

1 participant