fix(router): opening links in new window
Shift-clicks on router-links should not prevent browser default action.
A follow on to:
1ac9dda93d
This commit is contained in:
parent
35f714e438
commit
4c32cb952f
|
@ -209,9 +209,9 @@ export class RouterLinkWithHref implements OnChanges, OnDestroy {
|
||||||
ngOnChanges(changes: {}): any { this.updateTargetUrlAndHref(); }
|
ngOnChanges(changes: {}): any { this.updateTargetUrlAndHref(); }
|
||||||
ngOnDestroy(): any { this.subscription.unsubscribe(); }
|
ngOnDestroy(): any { this.subscription.unsubscribe(); }
|
||||||
|
|
||||||
@HostListener('click', ['$event.button', '$event.ctrlKey', '$event.metaKey'])
|
@HostListener('click', ['$event.button', '$event.ctrlKey', '$event.metaKey', '$event.shiftKey'])
|
||||||
onClick(button: number, ctrlKey: boolean, metaKey: boolean): boolean {
|
onClick(button: number, ctrlKey: boolean, metaKey: boolean, shiftKey: boolean): boolean {
|
||||||
if (button !== 0 || ctrlKey || metaKey) {
|
if (button !== 0 || ctrlKey || metaKey || shiftKey) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -337,7 +337,7 @@ export declare class RouterLinkWithHref implements OnChanges, OnDestroy {
|
||||||
constructor(router: Router, route: ActivatedRoute, locationStrategy: LocationStrategy);
|
constructor(router: Router, route: ActivatedRoute, locationStrategy: LocationStrategy);
|
||||||
ngOnChanges(changes: {}): any;
|
ngOnChanges(changes: {}): any;
|
||||||
ngOnDestroy(): any;
|
ngOnDestroy(): any;
|
||||||
onClick(button: number, ctrlKey: boolean, metaKey: boolean): boolean;
|
onClick(button: number, ctrlKey: boolean, metaKey: boolean, shiftKey: boolean): boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @stable */
|
/** @stable */
|
||||||
|
|
Loading…
Reference in New Issue