-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
bug: ion-datetime
selecting a day past the max day value will disable arrow navigation on previous month
#25073
Comments
Thanks for the issue! This issue has been labeled as Please reproduce this issue in an Ionic starter application and provide a way for us to access it (GitHub repo, StackBlitz, etc). Without a reliable code reproduction, it is unlikely we will be able to resolve the issue, leading to it being closed. If you have already provided a code snippet and are seeing this message, it is likely that the code snippet was not enough for our team to reproduce the issue. For a guide on how to create a good reproduction, see our Contributing Guide. |
I confirm to have the same problem and it's really weird how and when happens. It appears to me that happens when you use property binding for |
@hardmaster92 thanks for the added detail & the reproduction! That is very strange behavior, but reproducible. I'm going to track this specific to Angular for now. I will need to dig in a little further to find the exact cause, but we can track this as a bug in the interim so others can find/follow it. |
ion-datetime
with one-way binding to min/max causes navigation to be disabled
@hardmaster92 apologies as I didn't catch this the first time reviewing, in your stackblitz example you are setting the Updating: <ion-datetime [min]="min" [max]="min" [value]="initialDate"></ion-datetime> to: <ion-datetime [min]="min" [max]="max" [value]="initialDate"></ion-datetime> Should resolve your issue. @alexooi could you provide a reproduction for your issue? |
@sean-perkins I am able to reproduce the issue with @hardmaster92's link. I changed "min" to "max" for [max] and the arrow is disabled if I select 8 Mar onwards. The arrow is not disabled for 7 Mar and before. |
@sean-perkins sorry for the mistake, I fixed it and updated to the latest ionic, check the example again. Now the arrows are enabled (not sure if updating ionic also helped) but if you select a date from March then the navigation becomes disabled which is also weird |
Thank you both for following up! I've been able to discover "what is happening". When calculating if the next/previous month should be disabled, we offset the active (working parts) month value +/- 1 and check if the date is before or after your This is problematic, because if the I need to update the comparison logic to ignore days of the month, for next/previous logic. I'll post a dev build when that is available. Thanks! |
ion-datetime
with one-way binding to min/max causes navigation to be disabledion-datetime
selecting a day past the max day value will disable arrow navigation on previous month
Could either of you test with this dev build and let me know if you have any issues? 6.1.3-dev.11650481711.1ca044fb |
@sean-perkins I have yet to set up a stackblitz project - apologies for that. The dev build breaks a behaviour that was working fine previously. Now, when I am in the month of |
@alexooi can you clone this repo and adjust the parameters to match the behavior you are seeing? https://github.com/sean-perkins/ion-datetime-min-max-25073 I've been having issues with Stackblitz recently and it not actually installing the dev build, even though it is specified in the project dependencies in their interface. The repo above uses the dev build. I was unable to get the previous navigation to be disabled in the max month. |
@sean-perkins I can't push to your repo, might be due to the fact that I have yet to set up the SSH key for my github account. It's getting late here so I will just paste the date that I tested with, hope that's ok with you. |
@alexooi thanks for the extra information, that was super helpful! Here is an updated dev build:
I've also updated the Github repo with your reproduction data & the latest dev build, if you could also confirm for me. |
@sean-perkins I can confirm that the dev build works perfectly! Thank you so much for your time and effort into resolving this. Much appreciated! |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out. |
Prerequisites
Ionic Framework Version
Current Behavior
In ion-datetime with min and max values set, when a date other than the default date value is selected, the navigation arrow is incorrectly disabled.
Expected Behavior
In ion-datetime with min and max values set, when a date other than the default date value is selected, the navigation arrow is not disabled.
Steps to Reproduce
2022-04-07.21-49-38.mp4
Code Reproduction URL
No response
Ionic Info
Ionic:
Ionic CLI : 6.16.3 (C:\Users\alexo\AppData\Roaming\npm\node_modules@ionic\cli)
Ionic Framework : @ionic/angular 6.0.14
@angular-devkit/build-angular : 12.2.16
@angular-devkit/schematics : 12.1.1
@angular/cli : 12.1.4
@ionic/angular-toolkit : 4.0.0
Capacitor:
Capacitor CLI : 2.4.6
@capacitor/android : 2.5.0
@capacitor/core : 2.4.6
@capacitor/ios : 2.5.0
Utility:
cordova-res : 0.15.3
native-run : 1.3.0
System:
NodeJS : v14.15.4 (C:\Program Files\nodejs\node.exe)
npm : 6.14.13
OS : Windows 10
Additional Information
No response
The text was updated successfully, but these errors were encountered: