mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 12:29:55 +08:00
fix(select): emit the ionSelect option when selecting an option
This commit is contained in:
@ -296,6 +296,7 @@ export class Select extends Ion implements AfterContentInit, ControlValueAccesso
|
||||
handler: () => {
|
||||
this.onChange(input.value);
|
||||
this.ionChange.emit(input.value);
|
||||
input.ionSelect.emit(input.value);
|
||||
}
|
||||
};
|
||||
}));
|
||||
@ -319,7 +320,14 @@ export class Select extends Ion implements AfterContentInit, ControlValueAccesso
|
||||
label: input.text,
|
||||
value: input.value,
|
||||
checked: input.selected,
|
||||
disabled: input.disabled
|
||||
disabled: input.disabled,
|
||||
handler: (selectedOption: any) => {
|
||||
// Only emit the select event if it is being checked
|
||||
// For multi selects this won't emit when unchecking
|
||||
if (selectedOption.checked) {
|
||||
input.ionSelect.emit(input.value);
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user