fix(select): emit the ionSelect option when selecting an option

This commit is contained in:
Brandy Carney
2016-10-21 19:11:02 -04:00
parent f43539ebc7
commit 2eed5e24c2
6 changed files with 32 additions and 7 deletions

View File

@ -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);
}
}
};
});