@@ -22,8 +22,8 @@ import { IgxGridBaseComponent, IGridDataBindable } from './grid-base.component';
22
22
import { IgxColumnResizingService } from './grid-column-resizing.service' ;
23
23
import { IgxOverlayService } from '../services/overlay/overlay' ;
24
24
import { IgxGridExcelStyleFilteringComponent } from './filtering/excel-style/grid.excel-style-filtering.component' ;
25
- import { OverlaySettings , PositionSettings , VerticalAlignment , HorizontalAlignment } from '../services/overlay/utilities' ;
26
- import { ConnectedPositioningStrategy } from '../services/overlay/position/connected-positioning -strategy' ;
25
+ import { OverlaySettings , PositionSettings , VerticalAlignment } from '../services/overlay/utilities' ;
26
+ import { AutoPositionStrategy } from '../services/overlay/position/auto-position -strategy' ;
27
27
import { useAnimation } from '@angular/animations' ;
28
28
import { filter , takeUntil } from 'rxjs/operators' ;
29
29
import { Subject } from 'rxjs' ;
@@ -203,23 +203,9 @@ export class IgxGridHeaderComponent implements DoCheck, OnInit, OnDestroy {
203
203
private toggleFilterDropdown ( ) {
204
204
if ( ! this . _componentOverlayId ) {
205
205
const headerTarget = this . elementRef . nativeElement ;
206
+ const filterIconTarget = headerTarget . querySelector ( '.' + this . filterIconClassName ) ;
206
207
207
- const gridRect = this . grid . nativeElement . getBoundingClientRect ( ) ;
208
- const headerRect = headerTarget . getBoundingClientRect ( ) ;
209
-
210
- let x = headerRect . left ;
211
- let x1 = gridRect . left + gridRect . width ;
212
- x += window . pageXOffset ;
213
- x1 += window . pageXOffset ;
214
- if ( Math . abs ( x - x1 ) < 300 ) {
215
- this . _filterMenuOverlaySettings . positionStrategy . settings . horizontalDirection = HorizontalAlignment . Left ;
216
- this . _filterMenuOverlaySettings . positionStrategy . settings . horizontalStartPoint = HorizontalAlignment . Right ;
217
- } else {
218
- this . _filterMenuOverlaySettings . positionStrategy . settings . horizontalDirection = HorizontalAlignment . Right ;
219
- this . _filterMenuOverlaySettings . positionStrategy . settings . horizontalStartPoint = HorizontalAlignment . Left ;
220
- }
221
-
222
- this . _filterMenuOverlaySettings . positionStrategy . settings . target = headerTarget ;
208
+ this . _filterMenuOverlaySettings . positionStrategy . settings . target = filterIconTarget ;
223
209
this . _filterMenuOverlaySettings . outlet = this . grid . outlet ;
224
210
225
211
this . _componentOverlayId =
@@ -246,7 +232,7 @@ export class IgxGridHeaderComponent implements DoCheck, OnInit, OnDestroy {
246
232
this . _filterMenuOverlaySettings = {
247
233
closeOnOutsideClick : true ,
248
234
modal : false ,
249
- positionStrategy : new ConnectedPositioningStrategy ( this . _filterMenuPositionSettings ) ,
235
+ positionStrategy : new AutoPositionStrategy ( this . _filterMenuPositionSettings ) ,
250
236
scrollStrategy : new AbsoluteScrollStrategy ( )
251
237
} ;
252
238
0 commit comments