Skip to content

Commit 3cbded6

Browse files
authored
fix(forms): use change event for select multiple (#9713)
1 parent 137fff9 commit 3cbded6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

modules/@angular/common/src/forms-deprecated/directives/select_multiple_control_value_accessor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ abstract class HTMLCollection {
4747
*/
4848
@Directive({
4949
selector: 'select[multiple][ngControl],select[multiple][ngFormControl],select[multiple][ngModel]',
50-
host: {'(input)': 'onChange($event.target)', '(blur)': 'onTouched()'},
50+
host: {'(change)': 'onChange($event.target)', '(blur)': 'onTouched()'},
5151
providers: [SELECT_MULTIPLE_VALUE_ACCESSOR]
5252
})
5353
export class SelectMultipleControlValueAccessor implements ControlValueAccessor {
@@ -182,4 +182,4 @@ export class NgSelectMultipleOption implements OnDestroy {
182182
}
183183
}
184184

185-
export const SELECT_DIRECTIVES = [SelectMultipleControlValueAccessor, NgSelectMultipleOption];
185+
export const SELECT_DIRECTIVES = [SelectMultipleControlValueAccessor, NgSelectMultipleOption];

modules/@angular/forms/src/directives/select_multiple_control_value_accessor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ abstract class HTMLCollection {
5050
@Directive({
5151
selector:
5252
'select[multiple][formControlName],select[multiple][formControl],select[multiple][ngModel]',
53-
host: {'(input)': 'onChange($event.target)', '(blur)': 'onTouched()'},
53+
host: {'(change)': 'onChange($event.target)', '(blur)': 'onTouched()'},
5454
providers: [SELECT_MULTIPLE_VALUE_ACCESSOR]
5555
})
5656
export class SelectMultipleControlValueAccessor implements ControlValueAccessor {
@@ -185,4 +185,4 @@ export class NgSelectMultipleOption implements OnDestroy {
185185
}
186186
}
187187

188-
export const SELECT_DIRECTIVES = [SelectMultipleControlValueAccessor, NgSelectMultipleOption];
188+
export const SELECT_DIRECTIVES = [SelectMultipleControlValueAccessor, NgSelectMultipleOption];

0 commit comments

Comments
 (0)