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 @@ -158,8 +158,13 @@ export class MdInputDirective {
158
158
_onBlur ( ) { this . focused = false ; }
159
159
160
160
_onInput ( ) {
161
- // This is a noop function and is used to let Angular recognize the changes
162
- // to the input element while typing. Listening to the `input` event is similar to NgControls.
161
+ // This is a noop function and is used to let Angular know whenever the value changes.
162
+ // Angular will run a new change detection each time the `input` event has been dispatched.
163
+ // It's necessary that Angular recognizes the value change, because when floatingLabel
164
+ // is set to false and Angular forms aren't used, the placeholder won't recognize the
165
+ // value changes and will not disappear.
166
+ // Listening to the input event wouldn't be necessary when the input is using the
167
+ // FormsModule or ReactiveFormsModule, because Angular forms also listens to input events.
163
168
}
164
169
165
170
/** Make sure the input is a supported type. */
You can’t perform that action at this time.
0 commit comments