Skip to content

Commit 2290063

Browse files
crisbetovivian-hu-zz
authored andcommitted
fix(progress-bar): account for query params when prefixing references (#13942)
Fixes the progress bar not accounting for URL query params when it prefixes its SVG references. Related to #13930.
1 parent 27347b5 commit 2290063

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/lib/progress-bar/progress-bar.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,12 @@ export interface MatProgressBarLocation {
6666
/** @docs-private */
6767
export function MAT_PROGRESS_BAR_LOCATION_FACTORY(): MatProgressBarLocation {
6868
const _document = inject(DOCUMENT);
69+
const _location = _document ? _document.location : null;
6970

7071
return {
71-
// Note that this needs to be a function, because Angular will only instantiate
72-
// this provider once, but we want the current location on each call.
73-
getPathname: () => (_document && _document.location && _document.location.pathname) || ''
72+
// Note that this needs to be a function, rather than a property, because Angular
73+
// will only resolve it once, but we want the current path on each call.
74+
getPathname: () => _location ? (_location.pathname + _location.search) : ''
7475
};
7576
}
7677

0 commit comments

Comments
 (0)