File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
src/material/autocomplete Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -831,13 +831,12 @@ export class MatAutocompleteTrigger
831831 // border-radius based on the overlay position.
832832 const panelClass = this . _aboveClass ;
833833
834- /**
835- * Calculate the vertical offset for the overlay when the input field has an outline appearance.
836- * In the outline appearance, the overlay should have extra space to display the label correctly.
837- */
838- const outlineHeight =
839- this . _formField ?. _floatingLabel ?. element . getBoundingClientRect ( ) . height || 0 ;
840- const offsetY = this . _formField ?. _hasOutline ( ) ? - outlineHeight / 2 : 0 ;
834+ // Calculate the vertical offset for the overlay when the input field has an outline appearance.
835+ // In the outline appearance, the overlay should have extra space to display the label correctly.
836+ let offsetY = 0 ;
837+ if ( this . _formField ?. _hasOutline ( ) ) {
838+ offsetY = - ( this . _formField ?. _floatingLabel ?. element . getBoundingClientRect ( ) . height || 0 ) / 2 ;
839+ }
841840
842841 const abovePositions : ConnectedPosition [ ] = [
843842 {
You can’t perform that action at this time.
0 commit comments