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

bug: The year / month selected in the year / month picker will be reflected in the calendar with a one-month shift. #24405

Closed
4 of 6 tasks
tatsuyasenbom opened this issue Dec 15, 2021 · 9 comments · Fixed by #24554
Labels
package: core @ionic/core package type: bug a confirmed bug report

Comments

@tatsuyasenbom
Copy link

tatsuyasenbom commented Dec 15, 2021

Prerequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x

Current Behavior

Safari on iPhone iOS 15.1

  • In Safari on iOS, after the ion-datetime embedded in ion-popover is displayed, the year / month selected in the year / month picker will be reflected in the calendar with a one-month shift.
iphone.mp4

Google Chrome on Android 12 or Windows10

  • However, it will be reflected correctly on Google Chrome on Android or Windows.
android.mp4

Expected Behavior

  • I want you to improve the behavior of Safari on iOS.

Steps to Reproduce

  1. Run the code below to build.
    <ion-label>{{ report_date | date:"yyyy年MM月dd日 (EEE)" }}</ion-label>
    <ion-popover [isOpen]="isPopover" arrow="false" style="--offset-y: -35%;">
      <ng-template>
        <ion-datetime (ionChange)="onChangeDate($event)" showDefaultTitle="true" presentation="date">
          <div slot="title">報告日</div>
        </ion-datetime>
      </ng-template>
    </ion-popover>
  2. I did the same operation as the video I uploaded to Current Behavior.

Code Reproduction URL

Ionic Info

Ionic:

   Ionic CLI                     : 6.18.1 (C:\Users\Administrator\AppData\Roaming\npm\node_modules\@ionic\cli)
   Ionic Framework               : @ionic/angular 6.0.1
   @angular-devkit/build-angular : 13.0.4
   @angular-devkit/schematics    : 13.0.4
   @angular/cli                  : 13.0.4
   @ionic/angular-toolkit        : 5.0.3

Capacitor:

   Capacitor CLI      : 3.3.3
   @capacitor/android : not installed
   @capacitor/core    : 3.3.3
   @capacitor/ios     : not installed

Utility:

   cordova-res : 0.15.4
   native-run  : 1.5.0

System:

   NodeJS : v14.17.0 (C:\Program Files\nodejs\node.exe)
   npm    : 6.14.13
   OS     : Windows 10

Additional Information

No response

@ionitron-bot ionitron-bot bot added the triage label Dec 15, 2021
@averyjohnston
Copy link
Contributor

Thanks for the issue. Could you create a starter app that reproduces the problem and post a link to the repo here?

@averyjohnston averyjohnston added the ionitron: needs reproduction a code reproduction is needed from the issue author label Dec 15, 2021
@ionitron-bot
Copy link

ionitron-bot bot commented Dec 15, 2021

Thanks for the issue! This issue has been labeled as needs reproduction. This label is added to issues that need a code reproduction.

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.

@ionitron-bot ionitron-bot bot removed the triage label Dec 15, 2021
@tatsuyasenbom
Copy link
Author

@averyjohnston averyjohnston added triage and removed ionitron: needs reproduction a code reproduction is needed from the issue author labels Dec 16, 2021
@averyjohnston
Copy link
Contributor

Thanks! I'm able to replicate. It looks like the issue is that the datetime is too small, which is causing the intersection observers to fire when they shouldn't. As a workaround, you can set the datetime to a higher width -- it looks like 276px does the trick.

Some other interesting things:

  • I could only reproduce on iOS 15.0, 15.1, and 15.2. I could not reproduce on iOS 14.7.
  • The bug only happens on iOS mode. MD mode works, even on iOS 15.

@averyjohnston averyjohnston added package: core @ionic/core package type: bug a confirmed bug report labels Dec 16, 2021
@ionitron-bot ionitron-bot bot removed the triage label Dec 16, 2021
@tatsuyasenbom
Copy link
Author

Thanks! I'm able to replicate. It looks like the issue is that the datetime is too small, which is causing the intersection observers to fire when they shouldn't. As a workaround, you can set the datetime to a higher width -- it looks like 276px does the trick.

Some other interesting things:

  • I could only reproduce on iOS 15.0, 15.1, and 15.2. I could not reproduce on iOS 14.7.
  • The bug only happens on iOS mode. MD mode works, even on iOS 15.

Thank you for your answer !

I have avoided this phenomenon by fixing the mode to md once.

I'm looking forward to working properly with ios mode by default !

@liamdebeasi
Copy link
Contributor

Thanks for the issue. Can you try the following dev build and let me know if it resolves the issue?

npm install @ionic/[email protected]

@tatsuyasenbom
Copy link
Author

tatsuyasenbom commented Jan 12, 2022

Thanks for the issue. Can you try the following dev build and let me know if it resolves the issue?

npm install @ionic/[email protected]

Thank you very much for contacting me.

I built tatsuyasenbom/ionic-angular-sample and confirmed that Safari on iPhone iOS 15.2 improved the problem.

@liamdebeasi
Copy link
Contributor

Glad to hear the fix is working for you! This has been resolved via #24554, and a fix will be available in an upcoming release of Ionic Framework.

@ionitron-bot
Copy link

ionitron-bot bot commented Feb 11, 2022

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.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Feb 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: core @ionic/core package type: bug a confirmed bug report
Projects
None yet
3 participants