@@ -14,7 +14,12 @@ import {
14
14
} from '@angular/core' ;
15
15
import { takeUntilDestroyed } from '@angular/core/rxjs-interop' ;
16
16
import { FormControl , ReactiveFormsModule , Validators } from '@angular/forms' ;
17
- import { NavigationEnd , Router , RouterLink } from '@angular/router' ;
17
+ import {
18
+ ActivatedRoute ,
19
+ NavigationEnd ,
20
+ Router ,
21
+ RouterLink ,
22
+ } from '@angular/router' ;
18
23
import { TranslocoDirective , TranslocoService } from '@jsverse/transloco' ;
19
24
import { FastSvgComponent } from '@push-based/ngx-fast-svg' ;
20
25
import { debounceTime , filter , startWith , tap } from 'rxjs' ;
@@ -64,6 +69,7 @@ export class SearchDialogComponent implements OnInit, OnDestroy {
64
69
private readonly _router = inject ( Router ) ;
65
70
private readonly _destroyRef = inject ( DestroyRef ) ;
66
71
private readonly _localizeService = inject ( AlLocalizeService ) ;
72
+ private readonly _activatedRoute = inject ( ActivatedRoute ) ;
67
73
68
74
@HostListener ( 'click' , [ '$event.target' ] ) onClick ( target : HTMLElement ) : void {
69
75
if ( target . classList . contains ( 'al-overlay' ) ) {
@@ -128,6 +134,7 @@ export class SearchDialogComponent implements OnInit, OnDestroy {
128
134
queryParams : {
129
135
q : this . searchForm . value ,
130
136
} ,
137
+ relativeTo : this . _activatedRoute ,
131
138
} ) ;
132
139
this . closeSearch ( ) ;
133
140
}
0 commit comments