Closed Arieru closed 5 years ago
can we see ur code? Html and ts?
I'm experiencing the same issue.
I'm having the same issue.
Both in chrome dev tools as on native.
HTML:
<ion-item>
<ion-label position="stacked">Start</ion-label>
<ion-input [liIonic4Datepicker]="startDatePickerObj" readonly formControlName="startDate"></ion-input>
</ion-item>
<ion-item>
<ion-label position="stacked">End</ion-label>
<ion-input [liIonic4Datepicker]="endDatePickerObj" readonly formControlName="endDate"></ion-input>
</ion-item
TS: (this code gets executed in ngOnInit)
const datePickerOptions: any = {
closeOnSelect: true,
mondayFirst: true,
clearButton: false,
yearInAscending: true,
btnCloseSetInReverse: true,
btnProperties: {
expand: "block",
fill: "",
size: "",
disabled: "",
strong: "",
color: ""
}
};
// Get translations of the calendar messages for the labels
this.translate.get("CALENDAR").subscribe(messages => {
this.startDatePickerObj.todayLabel = messages.Today;
this.startDatePickerObj.titleLabel = messages.Title;
this.startDatePickerObj.closeLabel = messages.Close;
this.startDatePickerObj.monthsList = messages.Months;
this.startDatePickerObj.weeksList = messages.Days;
this.endDatePickerObj.todayLabel = messages.Today;
this.endDatePickerObj.titleLabel = messages.Title;
this.endDatePickerObj.closeLabel = messages.Close;
this.endDatePickerObj.monthsList = messages.Months;
this.endDatePickerObj.weeksList = messages.Days;
});
// Make a copy of options so they don't point to same reference
this.startDatePickerObj = JSON.parse(JSON.stringify(datePickerOptions));
this.endDatePickerObj = JSON.parse(JSON.stringify(datePickerOptions));
this.startDatePickerObj.toDate = new Date();
this.endDatePickerObj.toDate = new Date();
Install the latest version, that fixed this issue for my case.
I use Chrome's device toolbar to simulate mobile views, when I use an Android device (Pixel, Pixel 2) there are no errors, but whenever I use an IOS device (Iphone X, Ipad), it opens the modal twice. (Note: I used the picker as a Directive.)
(I only clicked once.) IOS device view:
ANDROID device view: