@@ -123,8 +123,8 @@ export class MatAutocompleteTrigger implements ControlValueAccessor, OnDestroy {
123123 /** Strategy that is used to position the panel. */
124124 private _positionStrategy : ConnectedPositionStrategy ;
125125
126- /** Whether or not the placeholder state is being overridden. */
127- private _manuallyFloatingPlaceholder = false ;
126+ /** Whether or not the label state is being overridden. */
127+ private _manuallyFloatingLabel = false ;
128128
129129 /** The subscription for closing actions (some are bound to document). */
130130 private _closingActionsSubscription : Subscription ;
@@ -163,7 +163,7 @@ export class MatAutocompleteTrigger implements ControlValueAccessor, OnDestroy {
163163 /** Opens the autocomplete suggestion panel. */
164164 openPanel ( ) : void {
165165 this . _attachOverlay ( ) ;
166- this . _floatPlaceholder ( ) ;
166+ this . _floatLabel ( ) ;
167167 }
168168
169169 /** Closes the autocomplete suggestion panel. */
@@ -173,14 +173,14 @@ export class MatAutocompleteTrigger implements ControlValueAccessor, OnDestroy {
173173 this . _closingActionsSubscription . unsubscribe ( ) ;
174174 }
175175
176- this . _resetPlaceholder ( ) ;
176+ this . _resetLabel ( ) ;
177177
178178 if ( this . _panelOpen ) {
179179 this . autocomplete . _isOpen = this . _panelOpen = false ;
180180
181181 // We need to trigger change detection manually, because
182182 // `fromEvent` doesn't seem to do it at the proper time.
183- // This ensures that the placeholder is reset when the
183+ // This ensures that the label is reset when the
184184 // user clicks outside.
185185 this . _changeDetectorRef . detectChanges ( ) ;
186186 }
@@ -307,33 +307,33 @@ export class MatAutocompleteTrigger implements ControlValueAccessor, OnDestroy {
307307 _handleFocus ( ) : void {
308308 if ( ! this . _element . nativeElement . readOnly ) {
309309 this . _attachOverlay ( ) ;
310- this . _floatPlaceholder ( true ) ;
310+ this . _floatLabel ( true ) ;
311311 }
312312 }
313313
314314 /**
315- * In "auto" mode, the placeholder will animate down as soon as focus is lost.
315+ * In "auto" mode, the label will animate down as soon as focus is lost.
316316 * This causes the value to jump when selecting an option with the mouse.
317- * This method manually floats the placeholder until the panel can be closed.
318- * @param shouldAnimate Whether the placeholder should be animated when it is floated.
317+ * This method manually floats the label until the panel can be closed.
318+ * @param shouldAnimate Whether the label should be animated when it is floated.
319319 */
320- private _floatPlaceholder ( shouldAnimate = false ) : void {
321- if ( this . _formField && this . _formField . floatPlaceholder === 'auto' ) {
320+ private _floatLabel ( shouldAnimate = false ) : void {
321+ if ( this . _formField && this . _formField . floatLabel === 'auto' ) {
322322 if ( shouldAnimate ) {
323- this . _formField . _animateAndLockPlaceholder ( ) ;
323+ this . _formField . _animateAndLockLabel ( ) ;
324324 } else {
325- this . _formField . floatPlaceholder = 'always' ;
325+ this . _formField . floatLabel = 'always' ;
326326 }
327327
328- this . _manuallyFloatingPlaceholder = true ;
328+ this . _manuallyFloatingLabel = true ;
329329 }
330330 }
331331
332- /** If the placeholder has been manually elevated, return it to its normal state. */
333- private _resetPlaceholder ( ) : void {
334- if ( this . _manuallyFloatingPlaceholder ) {
335- this . _formField . floatPlaceholder = 'auto' ;
336- this . _manuallyFloatingPlaceholder = false ;
332+ /** If the label has been manually elevated, return it to its normal state. */
333+ private _resetLabel ( ) : void {
334+ if ( this . _manuallyFloatingLabel ) {
335+ this . _formField . floatLabel = 'auto' ;
336+ this . _manuallyFloatingLabel = false ;
337337 }
338338 }
339339
0 commit comments