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

[Calendar] onChange is not called anymore when date is changed without changing hours #1603

Open
Ikaer opened this issue Jul 24, 2020 · 2 comments
Labels
lang/javascript Anything involving JavaScript state/awaiting-investigation Anything which needs more investigation type/bug Any issue which is a bug or PR which fixes a bug

Comments

@Ikaer
Copy link

Ikaer commented Jul 24, 2020

Bug Report

The change made in #1329 for bug issue #1460 has create regression in our apps. Before this pull, onChange was called at date selection and hour selection. Now its only be called after hour selection.
I understand why it's have been changed, it's definitely more logical to do it that way to avoid multiple UI refresh or data fetch.
But there is a scenario which create a problem (described below).

Steps to reproduce

  1. Use a simple calendar (date and time + popup) with the function onChange doing something (refresh ui, ajax call, etc.)
  2. Select a first date and time, call to onChange is done.
  3. Reopen the calendar
  4. Pick only a date, the input is updated
  5. Focus out the calendar popup, no call to onChange is made

Expected result

In case of popup focus out, if at least one date have been picked even without picking hour, onChange should be called too.

Actual result

Input have a new date but event onChange was not fired.

Testcase

https://jsfiddle.net/5hcjvk3d/1/

Version

2.8.6

@Ikaer Ikaer added state/awaiting-investigation Anything which needs more investigation state/awaiting-triage Any issues or pull requests which haven't yet been triaged type/bug Any issue which is a bug or PR which fixes a bug labels Jul 24, 2020
@lubber-de lubber-de removed the state/awaiting-triage Any issues or pull requests which haven't yet been triaged label Jul 24, 2020
@lubber-de
Copy link
Member

We try to figure something out in case the input field already got some date (only then the selection of a date in a datetime field will be updated beforehand)
In the meantime, you may use onSelect instead which is still triggered on every cell click
See https://jsfiddle.net/lubber/derqb5hp/1/

@lubber-de lubber-de added the lang/javascript Anything involving JavaScript label Jul 24, 2020
@Ikaer
Copy link
Author

Ikaer commented Jul 24, 2020

@lubber-de thanks for the tip. I didn't think about using onSelect. It will do for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang/javascript Anything involving JavaScript state/awaiting-investigation Anything which needs more investigation type/bug Any issue which is a bug or PR which fixes a bug
Projects
None yet
Development

No branches or pull requests

2 participants