Skip to content

Commit

Permalink
fix(forms): use change event for select multiple (#9713)
Browse files Browse the repository at this point in the history
  • Loading branch information
robwormald committed Jul 1, 2016
1 parent 137fff9 commit 3cbded6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Expand Up @@ -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 {
Expand Down Expand Up @@ -182,4 +182,4 @@ export class NgSelectMultipleOption implements OnDestroy {
} }
} }


export const SELECT_DIRECTIVES = [SelectMultipleControlValueAccessor, NgSelectMultipleOption]; export const SELECT_DIRECTIVES = [SelectMultipleControlValueAccessor, NgSelectMultipleOption];
Expand Up @@ -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 {
Expand Down Expand Up @@ -185,4 +185,4 @@ export class NgSelectMultipleOption implements OnDestroy {
} }
} }


export const SELECT_DIRECTIVES = [SelectMultipleControlValueAccessor, NgSelectMultipleOption]; export const SELECT_DIRECTIVES = [SelectMultipleControlValueAccessor, NgSelectMultipleOption];

0 comments on commit 3cbded6

Please sign in to comment.