ionic-team / ionic-framework

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
https://ionicframework.com
MIT License
51.02k stars 13.51k forks source link

bug: ion-datetime sometimes resets the value when using within a modal sheet to select just a time #24704

Closed mstichweh closed 2 years ago

mstichweh commented 2 years ago

Ionic version:

[ ] 4.x [ ] 5.x [ x] 6.x

I'm submitting a ...

[x ] bug report [ ] feature request

Current behavior:

When using the new ion-datetime component within a modal sheet to select just a time, the value switches to "00:00" from time to time. This happens when reopening the modal after it was closed without pressing the "done" button. It is always a random count of reopenings to reproduce this issue.

Expected behavior:

The selected time should always be the provided value.

Steps to reproduce:

Related code: Demo-App: https://github.com/mstichweh/ion-datetime-time-modal-bug.git

<ion-button id="trigger">Time</ion-button>
<ion-modal
trigger="trigger"
[breakpoints]="[0, 0.3]"
[initialBreakpoint]="0.3"
>
<ng-template>
    <ion-content>
        <ion-datetime [value]="'10:30'" [presentation]="'time'">
        </ion-datetime>
    </ion-content>
</ng-template>
</ion-modal>

Other information:

Ionic info:

Ionic:

   Ionic CLI                     : 6.16.3 (/usr/local/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 6.0.5
   @angular-devkit/build-angular : 12.2.15
   @angular-devkit/schematics    : 12.2.15
   @angular/cli                  : 12.2.15
   @ionic/angular-toolkit        : 5.0.3

Capacitor:

   Capacitor CLI      : 2.4.7
   @capacitor/android : 2.4.7
   @capacitor/core    : 2.4.7
   @capacitor/ios     : 2.4.7

Utility:

   cordova-res                          : not installed globally
   native-run (update available: 1.5.0) : 0.3.0

System:

   NodeJS : v14.18.2 (/usr/local/bin/node)
   npm    : 7.24.2
   OS     : macOS Big Sur
ionitron-bot[bot] commented 2 years ago

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.

mstichweh commented 2 years ago

GitHub project is provided now: https://github.com/mstichweh/ion-datetime-time-modal-bug.git

liamdebeasi commented 2 years ago

Thanks for the reproduction. Can you provide some steps to reproduce the issue? I am testing this on Chrome 98 and cannot reproduce the described behavior.

ionitron-bot[bot] commented 2 years ago

Thanks for the issue! This issue is being closed due to the lack of a reply. 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.

Thank you for using Ionic!