@ionic/react 8.8.1-dev.11774273905.1c3b9598 → 8.8.1-dev.11774384072.1e807ca8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -729,6 +729,11 @@ const createRoutingComponent = (tagName, customElement) => {
|
|
|
729
729
|
this.handleClick = (e) => {
|
|
730
730
|
const { routerLink, routerDirection, routerOptions, routerAnimation } = this.props;
|
|
731
731
|
if (routerLink !== undefined) {
|
|
732
|
+
// Allow modifier key clicks (ctrl/cmd/shift) to open the link in a new tab/window
|
|
733
|
+
// without triggering SPA navigation on the current page.
|
|
734
|
+
if (e.metaKey || e.ctrlKey || e.shiftKey) {
|
|
735
|
+
return;
|
|
736
|
+
}
|
|
732
737
|
e.preventDefault();
|
|
733
738
|
this.context.navigate(routerLink, routerDirection, undefined, routerAnimation, routerOptions);
|
|
734
739
|
}
|
|
@@ -1885,6 +1890,9 @@ const IonRouterContext = React.createContext({
|
|
|
1885
1890
|
back: () => {
|
|
1886
1891
|
throw new Error('An Ionic Router is required for IonRouterContext');
|
|
1887
1892
|
},
|
|
1893
|
+
navigateRoot: () => {
|
|
1894
|
+
throw new Error('An Ionic Router is required for IonRouterContext');
|
|
1895
|
+
},
|
|
1888
1896
|
canGoBack: () => {
|
|
1889
1897
|
throw new Error('An Ionic Router is required for IonRouterContext');
|
|
1890
1898
|
},
|
|
@@ -1901,9 +1909,10 @@ function useIonRouter() {
|
|
|
1901
1909
|
back: context.back,
|
|
1902
1910
|
push: context.push,
|
|
1903
1911
|
goBack: context.back,
|
|
1912
|
+
navigateRoot: context.navigateRoot,
|
|
1904
1913
|
canGoBack: context.canGoBack,
|
|
1905
1914
|
routeInfo: context.routeInfo,
|
|
1906
|
-
}), [context.back, context.push, context.canGoBack, context.routeInfo]);
|
|
1915
|
+
}), [context.back, context.push, context.navigateRoot, context.canGoBack, context.routeInfo]);
|
|
1907
1916
|
}
|
|
1908
1917
|
|
|
1909
1918
|
class CreateAnimation extends React.PureComponent {
|
|
@@ -2499,6 +2508,9 @@ class NavManager extends React.PureComponent {
|
|
|
2499
2508
|
back: (animationBuilder) => {
|
|
2500
2509
|
this.goBack(undefined, animationBuilder);
|
|
2501
2510
|
},
|
|
2511
|
+
navigateRoot: (pathname, animationBuilder) => {
|
|
2512
|
+
this.props.onNavigateRoot(pathname, animationBuilder);
|
|
2513
|
+
},
|
|
2502
2514
|
canGoBack: () => this.props.locationHistory.canGoBack(),
|
|
2503
2515
|
nativeBack: () => this.props.onNativeBack(),
|
|
2504
2516
|
routeInfo: this.props.routeInfo,
|