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 with showClearButton does not clear when selected date is from active month #26258

Closed
4 of 7 tasks
sagun-gautam opened this issue Nov 10, 2022 · 3 comments
Closed
4 of 7 tasks
Labels
package: core @ionic/core package type: bug a confirmed bug report

Comments

@sagun-gautam
Copy link

sagun-gautam commented Nov 10, 2022

Prerequisites

Ionic Framework Version

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

Current Behavior

ion-datetime picker with 'Clear' button enabled, does not clear the datetime picker if selected date is from current month.
Should the modal be closed after clear event? Does not close modal after clear event.

Expected Behavior

Should clear the current date value selection and close the datetime picker modal.

Steps to Reproduce

    <ion-input
      id="myDatePicker"
      class="ion-text-start"
      [formControlName]="fieldID"
      readonly="true"
    ></ion-input>

    <ion-modal
      trigger="myDatePicker"
      size="cover"
      alignment="center"
    >
      <ng-template>
        <ion-content>
          <ion-datetime
            #datetime
            presentation="date"
            [value]="pickerCurrentDate"
            [max]="field.max"
            [min]="field.min"
            [cancelText]="field.cancelText | translate"
            [doneText]="field.doneText | translate"
            [clearText]="field.clearText | translate"
            showDefaultButtons="true"
            showClearButton="true"
            (ionChange)="onChange(datetime.value)"
          >
          </ion-datetime>
        </ion-content>
      </ng-template>
    </ion-modal>

Code Reproduction URL

https://stackblitz.com/edit/angular-dgizef

Ionic Info

Ionic:
Ionic CLI : 6.18.1
Ionic Framework : @ionic/angular 6.3.5
@angular-devkit/build-angular : 12.2.18
@angular-devkit/schematics : not installed
@angular/cli : 12.2.18
@ionic/angular-toolkit : 2.3.3

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

Utility:
cordova-res : 0.15.4
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
npm : 6.14.16
OS : macOS Monterey
Xcode : Xcode 14.1 Build version 14B47b

Additional Information

No response

@ionitron-bot ionitron-bot bot added the triage label Nov 10, 2022
@sean-perkins sean-perkins changed the title bug: bug: Datetime with showClearButton does not clear when selected date is from active month Nov 10, 2022
@sean-perkins sean-perkins added package: core @ionic/core package type: bug a confirmed bug report labels Nov 10, 2022
@sean-perkins
Copy link
Contributor

@sagun-gautam thank you for reporting this issue. I am able to reproduce and have attached a reproduction to the original issue.

We will track this as a bug.

@sean-perkins
Copy link
Contributor

Here is a dev-build to test with: 6.3.7-dev.11668105872.16a97bcc

Thanks!

@ionitron-bot
Copy link

ionitron-bot bot commented Dec 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 Dec 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
Development

No branches or pull requests

2 participants