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: datetime picker in ion-modal crashes on selecting 12 AM #25714

Closed
4 of 7 tasks
sagun-gautam opened this issue Aug 4, 2022 · 5 comments · Fixed by #25716
Closed
4 of 7 tasks

bug: datetime picker in ion-modal crashes on selecting 12 AM #25714

sagun-gautam opened this issue Aug 4, 2022 · 5 comments · Fixed by #25716
Labels
package: core @ionic/core package type: bug a confirmed bug report

Comments

@sagun-gautam
Copy link

sagun-gautam commented Aug 4, 2022

Prerequisites

Ionic Framework Version

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

Current Behavior

On selecting 12 AM on time picker, current page freezes and crashes.

Expected Behavior

Date picker should close the modal.

Steps to Reproduce

Here is the code in component

    <ion-input id="user_time" [value]="inputValue" readonly="true" [placeholder]="'Select Time'"></ion-input>
    <ion-modal trigger="user_time" size="cover" alignment="center">
      <ng-template>
        <ion-content>
          <ion-datetime #notificationtime presentation="time" [value]="pickerValue" minuteValues="0"
            (ionChange)="timeChange(notificationtime)" [cancelText]="'Cancel'" [doneText]="'OK'" showDefaultButtons="true"
            hourCycle="h12"
          >
          </ion-datetime>
        </ion-content>
      </ng-template>
    </ion-modal>

To handle when value changes

  timeChange(event) {
    this.pickerValue = event.value;
    if (event && event.value) {
      let parsedTime = format(parseISO(event.value), 'HH');
      this.inputValue = parsedTime ? parsedTime : event.value;
    }
  }

Code Reproduction URL

https://stackblitz.com/edit/ionic6-angular13-w1sjhk?file=src/app/app.component.ts

Ionic Info

Ionic:

Ionic CLI : 6.18.1
Ionic Framework : @ionic/angular 6.2.0
@angular-devkit/build-angular : 12.2.16
@angular-devkit/schematics : 13.2.6
@angular/cli : 12.2.16
@ionic/angular-toolkit : 2.3.3

Cordova:

Cordova CLI : 11.0.0
Cordova Platforms : android 10.1.2, browser 6.0.0, ios 6.2.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.1, (and 20 other plugins)

Utility:

cordova-res : not installed globally
native-run : not installed globally

System:

Android SDK Tools : 26.1.1
ios-deploy : 1.11.4
ios-sim : 8.0.2
NodeJS : v14.19.0 (/usr/local/bin/node)
npm : 6.14.16
OS : macOS Monterey
Xcode : Xcode 13.4.1 Build version 13F100

Additional Information

No response

@ionitron-bot ionitron-bot bot added the triage label Aug 4, 2022
@liamdebeasi liamdebeasi self-assigned this Aug 4, 2022
@liamdebeasi
Copy link
Member

Thanks for the issue. Bisect indicates this regressed with #25514. I will look into a fix for this.

@liamdebeasi liamdebeasi added package: core @ionic/core package type: bug a confirmed bug report labels Aug 4, 2022
@ionitron-bot ionitron-bot bot removed the triage label Aug 4, 2022
@liamdebeasi
Copy link
Member

Here is a dev build if you are interested in testing the fix:

6.2.2-dev.11659622287.10988d77

Note: You may need to use this dev build locally in an Ionic starter app. I noticed some caching issues that caused dev builds to not install correctly on StackBlitz.

@liamdebeasi liamdebeasi removed their assignment Aug 4, 2022
@sagun-gautam
Copy link
Author

@liamdebeasi , the dev build worked without any issue.
Thanks.

@liamdebeasi
Copy link
Member

Thanks for the issue. This has been resolved via #25716, and a fix will be available in an upcoming release of Ionic Framework.

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 4, 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 Sep 4, 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
Development

Successfully merging a pull request may close this issue.

2 participants