Prerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already report this problem, without success.
Ionic Framework Version
v8.x
Current Behavior
When clicking ion-datetime-button a second time, date is not selected and previous month buttons does not work.
Expected Behavior
When a value has been set the first time and we open ion-datetime-button again, the date should still be selected and the previous and next month buttons should work properly.
Steps to Reproduce
- Go to https://ionicframework.com/docs/api/datetime-button#basic-usage and go to Basic usage.
- Click on the date button and select a date and confirm or tap outside picker.
- Click on date button a second time, date will no longer be selected and previous month < button will not work.
Code Reproduction URL
https://stackblitz.com/edit/8ba5snu3?file=index.html
Ionic Info
(This is from your own StackBlitz link, ionic info is not installed, but here is the package.json)
{
"name": "html-starter",
"private": true,
"type": "module",
"main": "index.ts",
"scripts": {
"dev": "vite",
"build": "vite build",
"start": "vite preview"
},
"dependencies": {
"@ionic/core": "8.8.7",
"ionicons": "8.0.13"
},
"devDependencies": {
"typescript": "~5.9.0",
"vite": "^8.0.0",
"vite-plugin-static-copy": "^4.0.0"
}
}