mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-10 00:27:41 +08:00
This reverts commit 9273f97a0cfbb007f20d4977bde3933d6933f9e5.
This commit is contained in:
@ -261,36 +261,11 @@ export class Datetime implements ComponentInterface {
|
||||
|
||||
const pickerOptions = this.generatePickerOptions();
|
||||
const picker = await this.pickerCtrl.create(pickerOptions);
|
||||
|
||||
this.isExpanded = true;
|
||||
picker.onDidDismiss().then(() => {
|
||||
this.isExpanded = false;
|
||||
this.setFocus();
|
||||
});
|
||||
picker.addEventListener('ionPickerColChange', async (event: any) => {
|
||||
const data = event.detail;
|
||||
|
||||
/**
|
||||
* Don't bother checking for non-dates as things like hours or minutes
|
||||
* are always going to have the same number of column options
|
||||
*/
|
||||
if (data.name !== 'month' && data.name !== 'day' && data.name !== 'year') { return; }
|
||||
|
||||
const colSelectedIndex = data.selectedIndex;
|
||||
const colOptions = data.options;
|
||||
|
||||
const changeData: any = {};
|
||||
changeData[data.name] = {
|
||||
value: colOptions[colSelectedIndex].value
|
||||
};
|
||||
|
||||
this.updateDatetimeValue(changeData);
|
||||
const columns = this.generateColumns();
|
||||
|
||||
picker.columns = columns;
|
||||
|
||||
await this.validate(picker);
|
||||
});
|
||||
await this.validate(picker);
|
||||
await picker.present();
|
||||
}
|
||||
@ -325,7 +300,6 @@ export class Datetime implements ComponentInterface {
|
||||
text: this.cancelText,
|
||||
role: 'cancel',
|
||||
handler: () => {
|
||||
this.updateDatetimeValue(this.value);
|
||||
this.ionCancel.emit();
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user