-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
DateInput - Navigating to a different month automatically selects a new date #2418
Comments
@rclai this behavior is by design and works fine for us but we'll happily accept a PR to add such a prop. |
@rclai the onChange event has a secondary argument,
hasUserManuallySelectedDate is false when date changes by navigation which allows you to control the update. |
Very good to know, thanks. Is this available in v1? |
@mcaneris |
Adding it here on this line should help: blueprint/packages/datetime/src/dateInput.tsx Line 297 in e53d5d4
|
@westrem would you like to submit a PR for this? |
Could someone clarify the design? It seems strange to get onChange event since nothing was changed, except some internal state of the control. (the day selection box stays 'in the previous month') If the goal is to track user changing the month, wouldn't it make more sense to make a separate event? |
@0xorial it looks like this issue was closed a long time ago with the resolution that you have a secondary argument in the |
@adidahiya the second argument is certainly an acceptable workaround. it's just otherwise the API of the library is VERY good and intuitive and this one comes as a surprise. |
@0xorial fair enough, thanks for the feedback. I would consider a PR to refactor this API to be more intuitive, probably as a breaking change for v4.x |
Totally agree with @0xorial In addition, the workaround with second argument has this problem: |
Bug report
@blueprintjs/datetime
1.25.4Chrome Version 65.0.3325.181 (Official Build) (64-bit)
OSX 10.13.4 (17E199)
Steps to reproduce
Actual behavior
Expected behavior
Comments
I don't know if this is behavior that you intend on keeping, but this sounds like something that could be controlled via a prop, and if that prop exists, I'm not seeing it in the documentation. It doesn't make sense to me to change the date that was selected using the month navigator by default.
The text was updated successfully, but these errors were encountered: