-
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: ios, next and prev buttons do not work when calendar grid is only partially visible #27913
Comments
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):
If the center of the datetime is out of view, then this call will return |
Here is a dev build if you are interested in testing the proposed fix:
Install Example:
|
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. |
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. |
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. |
Thanks! Here is a new dev build if you would like to test:
|
Amazing! |
Just to confirm, the latest release now also fixes the issues when an |
Great! I am going to keep this open until the linked PR is merged. |
Issue number: resolves #27913 --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> ## What is the current behavior? <!-- Please describe the current behavior that you are modifying. --> When determining what the changed month is, we grab the element at the center of the datetime and then grab the nearest calendar month. This works fine if the datetime is fully in view, but if the center point is out of the viewport then this will return `null`. As a result, scrolling in the datetime will break. ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> - We now check scroll position instead of querying for DOM elements at coordinates. This allows the view to continue to update even if the entire calendar body is outside the viewport. ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change, please describe the impact and migration path for existing applications below. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. --> Dev build: `7.2.2-dev.11690996559.1019674a`
Thanks for the issue. This has been resolved via #27917, and a fix will be available in an upcoming release of Ionic Framework. |
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
v6.x, v7.x
Current Behavior
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.
Steps to Reproduce
Code Reproduction URL
https://github.com/ionic-team/docs-demo
Ionic Info
Additional Information
No response
The text was updated successfully, but these errors were encountered: