Animates the placeholder up and locks it in position.
()
| 453 | |
| 454 | /** Animates the placeholder up and locks it in position. */ |
| 455 | _animateAndLockLabel(): void { |
| 456 | // This is for backwards compatibility only. Consumers of the form field might use |
| 457 | // this method. e.g. the autocomplete trigger. This method has been added to the non-MDC |
| 458 | // form field because setting "floatLabel" to "always" caused the label to float without |
| 459 | // animation. This is different in MDC where the label always animates, so this method |
| 460 | // is no longer necessary. There doesn't seem any benefit in adding logic to allow changing |
| 461 | // the floating label state without animations. The non-MDC implementation was inconsistent |
| 462 | // because it always animates if "floatLabel" is set away from "always". |
| 463 | // TODO(devversion): consider removing this method when releasing the MDC form field. |
| 464 | if (this._hasFloatingLabel()) { |
| 465 | this.floatLabel = 'always'; |
| 466 | } |
| 467 | } |
| 468 | |
| 469 | /** Initializes the registered form field control. */ |
| 470 | private _initializeControl(previousControl: MatFormFieldControl<unknown> | null) { |
no test coverage detected