File tree Expand file tree Collapse file tree 2 files changed +7
-12
lines changed Expand file tree Collapse file tree 2 files changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -831,8 +831,13 @@ export class MatAutocompleteTrigger
831831 // border-radius based on the overlay position.
832832 const panelClass = this . _aboveClass ;
833833
834- // Calculate vertical overlay offset with outline, or set to 0.
835- const offsetY = this . _formField ?. _getOverlayOffsetOutlined ( ) || 0 ;
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 ;
836841
837842 const abovePositions : ConnectedPosition [ ] = [
838843 {
Original file line number Diff line number Diff line change @@ -503,16 +503,6 @@ export class MatFormField
503503 return this . appearance === 'outline' ;
504504 }
505505
506- /**
507- * Calculate the vertical offset for the overlay when the input field has an outline appearance.
508- * In the outline appearance, the overlay should have extra space to display the label correctly.
509- * This function calculates the vertical offset needed.
510- */
511- _getOverlayOffsetOutlined ( ) {
512- const outlineHeight = this . _floatingLabel ?. element . getBoundingClientRect ( ) . height || 0 ;
513- return this . _hasOutline ( ) ? - outlineHeight / 2 : 0 ;
514- }
515-
516506 /**
517507 * Whether the label should display in the infix. Labels in the outline appearance are
518508 * displayed as part of the notched-outline and are horizontally offset to account for
You can’t perform that action at this time.
0 commit comments