You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: ios, next and prev buttons do not work when calendar grid is only partially visible #27913
The arrow buttons on ion-datetime do not work on iOS devices (web, simulator, real device) when the calendar grid is only partially visible (less than 3 rows of days).
Bringing the calendar into the viewport (3 rows or more), the arrow buttons work again.
Expected Behavior
The arrow buttons to switch between months work, even when only the arrow buttons are currently in visible to the user.
[WARN] You are not in an Ionic project directory. Project context may be
missing.
Ionic:
Ionic CLI : 7.1.1
Utility:
cordova-res : not installed globally
native-run : not installed globally
System:
NodeJS : v18.16.0
npm : 9.5.1
OS : macOS Unknown
If the center of the datetime is out of view, then this call will return null. It's possible for either only the top or the bottom part of datetime to be visible, so we should account for this.
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.
Activity
liamdebeasi commentedon Aug 2, 2023
Thanks for the report. The problem here is we get the month that is at the center of the datetime (on both x and y axes):
ionic-framework/core/src/components/datetime/datetime.tsx
Line 892 in 0c117cf
If the center of the datetime is out of view, then this call will return
null. It's possible for either only the top or the bottom part of datetime to be visible, so we should account for this.liamdebeasi commentedon Aug 2, 2023
Here is a dev build if you are interested in testing the proposed fix:
Install Example:
thomasmassmann commentedon Aug 2, 2023
Hi @liamdebeasi , thanks for taking a look at this. I tried the dev version in a real world project and it still shows the same error.
liamdebeasi commentedon Aug 2, 2023
Can you provide the sample project so I can test? I tested the dev build on the link provided in the original post, and it is now working as expected.
thomasmassmann commentedon Aug 2, 2023
Here is an example: https://github.com/thomasmassmann/ionicCalendarIssue
It is now working as long as a bit of 1 row with dates is visible. Only having the calendar header visible still results in the error.
My real-world project has the calendar in a modal, and in there in an accordion. That is a different thing to solve now.
liamdebeasi commentedon Aug 2, 2023
Thanks! Here is a new dev build if you would like to test:
thomasmassmann commentedon Aug 2, 2023
Amazing!
thomasmassmann commentedon Aug 3, 2023
Just to confirm, the latest release now also fixes the issues when an
ion-datetimeis embedded in anion-accordion.liamdebeasi commentedon Aug 3, 2023
Great! I am going to keep this open until the linked PR is merged.
fix(datetime): changing months work if partially visible (#27917)
liamdebeasi commentedon Aug 4, 2023
Thanks for the issue. This has been resolved via #27917, and a fix will be available in an upcoming release of Ionic Framework.
ionitron-bot commentedon Sep 3, 2023
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.