1- import { VerticalAlignment , HorizontalAlignment , PositionSettings , Size , Point , Util } from '../services/overlay/utilities' ;
1+ import { VerticalAlignment , HorizontalAlignment , PositionSettings , Size , Util , ConnectedFit } from '../services/overlay/utilities' ;
22import { IPositionStrategy } from '../services/overlay/position' ;
33import { fadeOut , fadeIn } from '../animations/main' ;
44import { IgxSelectBase } from './select.common' ;
55import { isIE } from '../core/utils' ;
6- import { BaseFitPositionStrategy , ConnectedFit } from '../services/overlay/position/base-fit-position-strategy' ;
6+ import { BaseFitPositionStrategy } from '../services/overlay/position/base-fit-position-strategy' ;
77import { DisplayDensity } from '../core/density' ;
88
99/** @hidden @internal */
@@ -44,7 +44,8 @@ export class SelectPositioningStrategy extends BaseFitPositionStrategy implement
4444 const rects = super . calculateElementRectangles ( contentElement ) ;
4545 // selectFit obj, to be used for both cases of initialCall and !initialCall(page scroll/overlay repositionAll)
4646 const selectFit : SelectFit = {
47- yOffset : this . global_yOffset , xOffset : this . global_xOffset ,
47+ verticalOffset : this . global_yOffset ,
48+ horizontalOffset : this . global_xOffset ,
4849 targetRect : rects . targetRect ,
4950 contentElementRect : rects . elementRect ,
5051 styles : this . global_styles
@@ -54,7 +55,7 @@ export class SelectPositioningStrategy extends BaseFitPositionStrategy implement
5455 selectFit . viewPortRect = Util . getViewportRect ( document ) ;
5556
5657 // Fill in the required selectFit object properties.
57- this . calculateVariables ( contentElement , selectFit ) ;
58+ this . calculateVariables ( selectFit ) ;
5859 selectFit . viewPortRect = Util . getViewportRect ( document ) ;
5960
6061 // Calculate how much to offset the overlay container.
@@ -118,8 +119,8 @@ export class SelectPositioningStrategy extends BaseFitPositionStrategy implement
118119
119120 // This method can be scrambled and combined in manageScrollToItem()
120121 private compensateYScroll ( selectFit : SelectFit , compensation : number ) {
121- selectFit . yOffset += compensation ;
122- this . global_yOffset = selectFit . yOffset ;
122+ selectFit . verticalOffset += compensation ;
123+ this . global_yOffset = selectFit . verticalOffset ;
123124 }
124125
125126 // Position the items outer container Below or Above the input.
@@ -163,16 +164,12 @@ export class SelectPositioningStrategy extends BaseFitPositionStrategy implement
163164 this . global_styles . contentElementNewWidth = selectFit . styles . contentElementNewWidth ;
164165 }
165166
166- private calculateVariables ( contentElement : HTMLElement , selectFit : SelectFit ) {
167- const targetRect = Util . getTargetRect ( this . settings ) ;
168- const contentElementRect = contentElement . getBoundingClientRect ( ) ;
167+ private calculateVariables ( selectFit : SelectFit ) {
169168 const itemHeight = this . getInteractionItemElement ( ) . getBoundingClientRect ( ) . height ;
170169 selectFit . styles = { } ;
171170 selectFit . itemElement = this . getInteractionItemElement ( ) ;
172171 selectFit . itemHeight = itemHeight ;
173172 selectFit . dropDownList = this . select . scrollContainer ;
174- selectFit . targetRect = targetRect ;
175- selectFit . contentElementRect = contentElementRect ;
176173 selectFit . inputElement = this . select . getEditElement ( ) ;
177174 // Calculate input and selected item elements style related variables
178175 this . calculateStyles ( selectFit ) ;
@@ -219,14 +216,14 @@ export class SelectPositioningStrategy extends BaseFitPositionStrategy implement
219216
220217 protected calculateYoffset ( selectFit : SelectFit ) {
221218 const contentElementTopLeftPointY = selectFit . contentElementRect . top ;
222- selectFit . yOffset =
219+ selectFit . verticalOffset =
223220 - ( selectFit . itemElement . getBoundingClientRect ( ) . top - contentElementTopLeftPointY + selectFit . styles . itemTextToInputTextDiff ) ;
224- this . global_yOffset = selectFit . yOffset ;
221+ this . global_yOffset = selectFit . verticalOffset ;
225222 }
226223
227224 protected calculateXoffset ( selectFit : SelectFit ) {
228- selectFit . xOffset = selectFit . styles . itemTextIndent - selectFit . styles . itemTextPadding ;
229- this . global_xOffset = selectFit . xOffset ;
225+ selectFit . horizontalOffset = selectFit . styles . itemTextIndent - selectFit . styles . itemTextPadding ;
226+ this . global_xOffset = selectFit . horizontalOffset ;
230227 }
231228}
232229
@@ -240,8 +237,8 @@ export interface SelectFit extends ConnectedFit {
240237 right ?: number ;
241238 top ?: number ;
242239 bottom ?: number ;
243- xOffset ?: number ;
244- yOffset ?: number ;
240+ horizontalOffset ?: number ;
241+ verticalOffset ?: number ;
245242
246243 // New properties
247244 inputElement ?: HTMLElement ;
0 commit comments