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

ion-datetime not working properly if it occurs more than once inside ion-item #15547

Closed
hebra opened this issue Sep 11, 2018 · 4 comments
Closed
Assignees
Labels

Comments

@hebra
Copy link

hebra commented Sep 11, 2018

Bug Report

Ionic Info
Run ionic info from a terminal/cmd prompt and paste the output below.

Ionic:

   ionic (Ionic CLI)          : 4.1.2 (/usr/local/lib/node_modules/ionic)
   Ionic Framework            : @ionic/angular 4.0.0-beta.8
   @angular-devkit/core       : 0.8.1
   @angular-devkit/schematics : 0.8.1
   @angular/cli               : 6.2.1
   @ionic/ng-toolkit          : 1.0.8
   @ionic/schematics-angular  : 1.0.6

Cordova:

   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms     : android 7.0.0, browser 5.0.4, ios 4.5.5
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.2, cordova-plugin-ionic-webview 2.0.3, (and 14 other plugins)

System:

   Android SDK Tools : 26.1.1 (/Users/heb/Library/Android/sdk)
   ios-deploy        : 2.0.0
   NodeJS            : v10.10.0 (/usr/local/Cellar/node/10.10.0/bin/node)
   npm               : 6.4.1
   OS                : macOS
   Xcode             : Xcode 10.0 Build version 10L232m

Describe the Bug
When 2 or more ion-datetime elements are included within the same ion-input the selected date is always populated to the last included item.

Steps to Reproduce
Steps to reproduce the behavior:

  1. Create a new Ionic project
  2. In the app.html create an ion-list -> ion-item and inside 2x ion-datetime
  3. Start the app via ionic serve
  4. Select the 1st date chooser and choose a date
  5. the selected date actually appears in the 2nd ion-datetime element

Related Code

<ion-list>
  <ion-item [lines]="5">
    <ion-datetime placeholder="START DATE"></ion-datetime>
    <ion-datetime placeholder="END DATE"></ion-datetime>
  </ion-item>
</ion-list>

Expected Behavior
The selected date picker value should appear in the correct datetime element.

@ionitron-bot ionitron-bot bot added the triage label Sep 11, 2018
@topalavlad
Copy link
Contributor

@hebra - can you paste the code or add a codepen example?
Is [(ngModel)] defined for your components?

@hebra
Copy link
Author

hebra commented Sep 14, 2018

@topalavlad the issue report was mis-formatted, just fixed it. It now also shows a code snippet.
There is no ngModel defined as it is a reactive form.

@topalavlad
Copy link
Contributor

topalavlad commented Sep 16, 2018

It looks like an issue:

The button that pop-ups up the date picker is set to absolute location (0, 0) and size (100%, 100%) so if you do inspect element on that row, the whole row is actually covered by the second datetime's button - button.datetime-cover

Check this comment out. Unfortunately I tried the same workaround as suggested there, but the button area becomes too small.

@ionitron-bot
Copy link

ionitron-bot bot commented Oct 18, 2018

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 Oct 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants