File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -176,8 +176,13 @@ export class MdInputDirective {
176
176
_onBlur ( ) { this . focused = false ; }
177
177
178
178
_onInput ( ) {
179
- // This is a noop function and is used to let Angular recognize the changes
180
- // to the input element while typing. Listening to the `input` event is similar to NgControls.
179
+ // This is a noop function and is used to let Angular know whenever the value changes.
180
+ // Angular will run a new change detection each time the `input` event has been dispatched.
181
+ // It's necessary that Angular recognizes the value change, because when floatingLabel
182
+ // is set to false and Angular forms aren't used, the placeholder won't recognize the
183
+ // value changes and will not disappear.
184
+ // Listening to the input event wouldn't be necessary when the input is using the
185
+ // FormsModule or ReactiveFormsModule, because Angular forms also listens to input events.
181
186
}
182
187
183
188
/** Make sure the input is a supported type. */
You can’t perform that action at this time.
0 commit comments