fix(forms): ensure select model updates in firefox and ie

Closes #6573

Closes #8148
This commit is contained in:
Kara Erickson
2016-04-20 15:50:50 -07:00
committed by Kara
parent 8db62151d2
commit c3daccd83b
2 changed files with 9 additions and 3 deletions
@@ -36,10 +36,16 @@ function _extractId(valueString: string): string {
/**
* The accessor for writing a value and listening to changes on a select element.
*
* Note: We have to listen to the 'change' event because 'input' events aren't fired
* for selects in Firefox and IE:
* https://bugzilla.mozilla.org/show_bug.cgi?id=1024350
* https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/4660045/
*
*/
@Directive({
selector: 'select[ngControl],select[ngFormControl],select[ngModel]',
host: {'(input)': 'onChange($event.target.value)', '(blur)': 'onTouched()'},
host: {'(change)': 'onChange($event.target.value)', '(blur)': 'onTouched()'},
providers: [SELECT_VALUE_ACCESSOR]
})
export class SelectControlValueAccessor implements ControlValueAccessor {