mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 20:33:32 +08:00
fix(datetime): change now emitted when picker is typed into (#24018)
This commit is contained in:
@ -64,7 +64,13 @@ export class PickerColumnInternal implements ComponentInterface {
|
|||||||
|
|
||||||
@Watch('value')
|
@Watch('value')
|
||||||
valueChange() {
|
valueChange() {
|
||||||
|
const { items, value } = this;
|
||||||
this.scrollActiveItemIntoView();
|
this.scrollActiveItemIntoView();
|
||||||
|
|
||||||
|
const findItem = items.find(item => item.value === value);
|
||||||
|
if (findItem) {
|
||||||
|
this.ionChange.emit(findItem);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -206,7 +212,6 @@ export class PickerColumnInternal implements ComponentInterface {
|
|||||||
|
|
||||||
if (selectedItem.value !== this.value) {
|
if (selectedItem.value !== this.value) {
|
||||||
this.value = selectedItem.value;
|
this.value = selectedItem.value;
|
||||||
this.ionChange.emit(selectedItem);
|
|
||||||
hapticSelectionEnd();
|
hapticSelectionEnd();
|
||||||
this.hapticsStarted = false;
|
this.hapticsStarted = false;
|
||||||
}
|
}
|
||||||
|
@ -107,7 +107,7 @@
|
|||||||
</ion-app>
|
</ion-app>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
const column = document.querySelector('ion-picker-column-internal');
|
const column = document.querySelector('ion-picker-column-internal#numeric-first');
|
||||||
column.addEventListener('ionChange', (ev) => {
|
column.addEventListener('ionChange', (ev) => {
|
||||||
console.log('Column change', ev.detail);
|
console.log('Column change', ev.detail);
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user