Fix intersaction Observer in fos-selections.
This commit is contained in:
parent
2f98910712
commit
3e12962add
|
@ -72,8 +72,9 @@ export class FosSelectionComponent {
|
|||
} else {
|
||||
this.activeSection = this.fos[0].id;
|
||||
}
|
||||
|
||||
this.setObserver();
|
||||
if(typeof IntersectionObserver !== "undefined") {
|
||||
this.setObserver();
|
||||
}
|
||||
this.cdr.detectChanges();
|
||||
});
|
||||
}
|
||||
|
@ -93,7 +94,7 @@ export class FosSelectionComponent {
|
|||
this.subscriptions.push(this.keywordControl.valueChanges.pipe(debounceTime(500), distinctUntilChanged()).subscribe(value => {
|
||||
this.keyword = value;
|
||||
this.findMatches(this.keyword);
|
||||
if (typeof document !== 'undefined') {
|
||||
if (typeof IntersectionObserver !== 'undefined') {
|
||||
setTimeout(() => {
|
||||
this.setObserver();
|
||||
});
|
||||
|
|
|
@ -105,7 +105,7 @@ export class FosComponent implements OnInit, OnDestroy {
|
|||
this.subscriptions.push(this.keywordControl.valueChanges.pipe(debounceTime(500), distinctUntilChanged()).subscribe(value => {
|
||||
this.keyword = value;
|
||||
this.findMatches(this.keyword);
|
||||
if (typeof document !== 'undefined') {
|
||||
if (typeof IntersectionObserver !== 'undefined') {
|
||||
setTimeout(() => {
|
||||
this.setObserver();
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue