mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
refactor(form-field): remove shouldPlaceholderFloat on MatFormFieldControl (#10293)
This commit is contained in:
@@ -37,14 +37,7 @@ export abstract class MatFormFieldControl<T> {
|
||||
readonly empty: boolean;
|
||||
|
||||
/** Whether the `MatFormField` label should try to float. */
|
||||
readonly shouldLabelFloat?: boolean;
|
||||
|
||||
/**
|
||||
* Whether the `MatFormField` placeholder should try to float.
|
||||
* @deprecated Use `shouldLabelFloat` instead.
|
||||
* @deletion-target 6.0.0
|
||||
*/
|
||||
readonly shouldPlaceholderFloat?: boolean;
|
||||
readonly shouldLabelFloat: boolean;
|
||||
|
||||
/** Whether the control is required. */
|
||||
readonly required: boolean;
|
||||
|
||||
@@ -316,8 +316,7 @@ export class MatFormField extends _MatFormFieldMixinBase
|
||||
}
|
||||
|
||||
_shouldLabelFloat() {
|
||||
return this._canLabelFloat && (this._control.shouldLabelFloat ||
|
||||
this._control.shouldPlaceholderFloat || this._shouldAlwaysFloat);
|
||||
return this._canLabelFloat && (this._control.shouldLabelFloat || this._shouldAlwaysFloat);
|
||||
}
|
||||
|
||||
_hideControlPlaceholder() {
|
||||
|
||||
@@ -1272,7 +1272,7 @@ export class MatSelect extends _MatSelectMixinBase implements AfterContentInit,
|
||||
* Implemented as part of MatFormFieldControl.
|
||||
* @docs-private
|
||||
*/
|
||||
get shouldPlaceholderFloat(): boolean {
|
||||
get shouldLabelFloat(): boolean {
|
||||
return this._panelOpen || !this.empty;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user