Skip to content

Commit a041c42

Browse files
naaajiiamysorto
authored andcommitted
feat: added ability to keep pathname and hash on version change
1 parent 015b9fd commit a041c42

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

material.angular.io/src/app/shared/version-picker/version-picker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export class VersionPicker {
3737
*/
3838
onVersionChanged(version: VersionInfo) {
3939
if (!version.url.startsWith(window.location.href)) {
40-
window.location.assign(version.url);
40+
window.location.assign(window.location.pathname ? (version.url + window.location.pathname + window.location.hash) : version.url );
4141
}
4242
}
4343
}

0 commit comments

Comments
 (0)