fix(forms): use change event for select multiple (#9713)

This commit is contained in:
Rob Wormald 2016-06-30 20:24:39 -07:00 committed by GitHub
parent 137fff9632
commit 3cbded6694
2 changed files with 4 additions and 4 deletions

View File

@ -47,7 +47,7 @@ abstract class HTMLCollection {
*/ */
@Directive({ @Directive({
selector: 'select[multiple][ngControl],select[multiple][ngFormControl],select[multiple][ngModel]', selector: 'select[multiple][ngControl],select[multiple][ngFormControl],select[multiple][ngModel]',
host: {'(input)': 'onChange($event.target)', '(blur)': 'onTouched()'}, host: {'(change)': 'onChange($event.target)', '(blur)': 'onTouched()'},
providers: [SELECT_MULTIPLE_VALUE_ACCESSOR] providers: [SELECT_MULTIPLE_VALUE_ACCESSOR]
}) })
export class SelectMultipleControlValueAccessor implements ControlValueAccessor { export class SelectMultipleControlValueAccessor implements ControlValueAccessor {
@ -182,4 +182,4 @@ export class NgSelectMultipleOption implements OnDestroy {
} }
} }
export const SELECT_DIRECTIVES = [SelectMultipleControlValueAccessor, NgSelectMultipleOption]; export const SELECT_DIRECTIVES = [SelectMultipleControlValueAccessor, NgSelectMultipleOption];

View File

@ -50,7 +50,7 @@ abstract class HTMLCollection {
@Directive({ @Directive({
selector: selector:
'select[multiple][formControlName],select[multiple][formControl],select[multiple][ngModel]', 'select[multiple][formControlName],select[multiple][formControl],select[multiple][ngModel]',
host: {'(input)': 'onChange($event.target)', '(blur)': 'onTouched()'}, host: {'(change)': 'onChange($event.target)', '(blur)': 'onTouched()'},
providers: [SELECT_MULTIPLE_VALUE_ACCESSOR] providers: [SELECT_MULTIPLE_VALUE_ACCESSOR]
}) })
export class SelectMultipleControlValueAccessor implements ControlValueAccessor { export class SelectMultipleControlValueAccessor implements ControlValueAccessor {
@ -185,4 +185,4 @@ export class NgSelectMultipleOption implements OnDestroy {
} }
} }
export const SELECT_DIRECTIVES = [SelectMultipleControlValueAccessor, NgSelectMultipleOption]; export const SELECT_DIRECTIVES = [SelectMultipleControlValueAccessor, NgSelectMultipleOption];