|
1 | 1 | import { Component, ElementRef, OnDestroy, OnInit, ViewChild, ViewContainerRef, inject } from '@angular/core'; |
2 | | -import { AbsoluteScrollStrategy, BlockScrollStrategy, CloseScrollStrategy, ConnectedPositioningStrategy, IgxOverlayService, NoOpScrollStrategy } from 'igniteui-angular/core'; |
| 2 | +import { AbsoluteScrollStrategy, BlockScrollStrategy, CloseScrollStrategy, ConnectedPositioningStrategy, GlobalPositionStrategy, IgxOverlayService, NoOpScrollStrategy } from 'igniteui-angular/core'; |
3 | 3 | import { IgxIconComponent } from 'igniteui-angular/icon'; |
4 | 4 | import { Subject } from 'rxjs'; |
5 | 5 | import { takeUntil } from 'rxjs/operators'; |
@@ -52,22 +52,26 @@ export class OverlayScrollSample2Component implements OnInit, OnDestroy { |
52 | 52 |
|
53 | 53 | public onClickScrollStrategy(strategy: string) { |
54 | 54 | let scrollStrategy; |
55 | | - const positionStrategy = new ConnectedPositioningStrategy(); |
| 55 | + let positionStrategy; |
56 | 56 | switch (strategy) { |
57 | 57 | case ('absolute'): |
58 | 58 | scrollStrategy = new AbsoluteScrollStrategy(); |
| 59 | + positionStrategy = new ConnectedPositioningStrategy(); |
59 | 60 | this._target = this.scrollDemo.nativeElement.children[0]; |
60 | 61 | break; |
61 | 62 | case ('block'): |
62 | 63 | scrollStrategy = new BlockScrollStrategy(); |
| 64 | + positionStrategy = new ConnectedPositioningStrategy(); |
63 | 65 | this._target = this.scrollDemo.nativeElement.children[1]; |
64 | 66 | break; |
65 | 67 | case ('close'): |
66 | 68 | scrollStrategy = new CloseScrollStrategy(); |
| 69 | + positionStrategy = new GlobalPositionStrategy(); |
67 | 70 | this._target = this.scrollDemo.nativeElement.children[2]; |
68 | 71 | break; |
69 | 72 | default: |
70 | 73 | scrollStrategy = new NoOpScrollStrategy(); |
| 74 | + positionStrategy = new ConnectedPositioningStrategy(); |
71 | 75 | this._target = this.scrollDemo.nativeElement.children[3]; |
72 | 76 | } |
73 | 77 | if (this._overlayId) { |
|
0 commit comments