mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
feat(select): add optional generic typings (#21514)
resolves https://github.com/ionic-team/ionic-framework/issues/20220
This commit is contained in:
@@ -1070,7 +1070,7 @@ ion-select,prop,value,any,undefined,false,false
|
||||
ion-select,method,open,open(event?: UIEvent | undefined) => Promise<any>
|
||||
ion-select,event,ionBlur,void,true
|
||||
ion-select,event,ionCancel,void,true
|
||||
ion-select,event,ionChange,SelectChangeEventDetail,true
|
||||
ion-select,event,ionChange,SelectChangeEventDetail<any>,true
|
||||
ion-select,event,ionFocus,void,true
|
||||
ion-select,css-prop,--padding-bottom
|
||||
ion-select,css-prop,--padding-end
|
||||
|
||||
@@ -1225,12 +1225,12 @@ export class SelectExample {
|
||||
|
||||
## Events
|
||||
|
||||
| Event | Description | Type |
|
||||
| ----------- | ---------------------------------------- | -------------------------------------- |
|
||||
| `ionBlur` | Emitted when the select loses focus. | `CustomEvent<void>` |
|
||||
| `ionCancel` | Emitted when the selection is cancelled. | `CustomEvent<void>` |
|
||||
| `ionChange` | Emitted when the value has changed. | `CustomEvent<SelectChangeEventDetail>` |
|
||||
| `ionFocus` | Emitted when the select has focus. | `CustomEvent<void>` |
|
||||
| Event | Description | Type |
|
||||
| ----------- | ---------------------------------------- | ------------------------------------------- |
|
||||
| `ionBlur` | Emitted when the select loses focus. | `CustomEvent<void>` |
|
||||
| `ionCancel` | Emitted when the selection is cancelled. | `CustomEvent<void>` |
|
||||
| `ionChange` | Emitted when the value has changed. | `CustomEvent<SelectChangeEventDetail<any>>` |
|
||||
| `ionFocus` | Emitted when the select has focus. | `CustomEvent<void>` |
|
||||
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -2,6 +2,6 @@ export type SelectInterface = 'action-sheet' | 'popover' | 'alert';
|
||||
|
||||
export type SelectCompareFn = (currentValue: any, compareValue: any) => boolean;
|
||||
|
||||
export interface SelectChangeEventDetail {
|
||||
value: any | any[] | undefined | null;
|
||||
export interface SelectChangeEventDetail<T = any> {
|
||||
value: T;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user