You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: Ion-datetime doesn't always initialize at the selected date #28516
I have searched for existing issues that already report this problem, without success.
Ionic Framework Version
v7.x
Current Behavior
When opening a ion-datetime in a ion-popover, the date doesn't always initialize at the selected date in v-model.
Once popover is opened, sometimes it shows janvier 1923
And other times it's fine, it shows juin 2023, the date in v-model.
This behavior is only occured with presentation property set to month-year or year.
Expected Behavior
When opening a ion-datetime, with presentation property set to month-year or year, in a ion-popover, the date should always initialize at the date in v-model.
Steps to Reproduce
Create a ion-datetime, set presentation property to month-year
Set a date through v-model, for instance set '2023-06-04T23:00:00.000+02:00'
Open and close multiple times the popover
The wheel picker position is sometimes aligned to the current date, sometimes to 1 century before (top of the wheel).
Hi, thank you for the bug report. I'm able to reproduce this. I've created a (more) minimal reproduction on stackblitz. I'm unable to reproduce the bug in Angular, React, or Javascript, although since it's sporadically occurring, it may be present in those as well but just more prominent in Vue.
Upon further reflection, it looks like this is a duplicate of #26234 (even though that one was reproducing only in Angular and this one is now reproducing (for me) only in Vue). As a workaround, you can use keep-contents-mounted on your Popover.
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.
Activity
mapsandapps commentedon Nov 13, 2023
Hi, thank you for the bug report. I'm able to reproduce this. I've created a (more) minimal reproduction on stackblitz. I'm unable to reproduce the bug in Angular, React, or Javascript, although since it's sporadically occurring, it may be present in those as well but just more prominent in Vue.
mapsandapps commentedon Nov 13, 2023
Upon further reflection, it looks like this is a duplicate of #26234 (even though that one was reproducing only in Angular and this one is now reproducing (for me) only in Vue). As a workaround, you can use
keep-contents-mountedon your Popover.ionitron-bot commentedon Dec 13, 2023
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.