@ionic/react-router 8.8.1-dev.11774029927.130994f5 → 8.8.1-dev.11774273905.1c3b9598

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
@@ -3090,9 +3090,9 @@ const IonRouter = ({ children, registerHistoryListener }) => {
3090
3090
  * @param routeAnimation A custom animation builder to override the
3091
3091
  * default "back" animation.
3092
3092
  */
3093
- const handleNavigateBack = (defaultHref = '/', routeAnimation) => {
3093
+ const handleNavigateBack = (defaultHref, routeAnimation) => {
3094
3094
  const config = getConfig();
3095
- defaultHref = defaultHref ? defaultHref : config && config.get('backButtonDefaultHref');
3095
+ defaultHref = defaultHref !== null && defaultHref !== void 0 ? defaultHref : (config && config.get('backButtonDefaultHref'));
3096
3096
  const routeInfo = locationHistory.current.current();
3097
3097
  // It's a linear navigation.
3098
3098
  if (routeInfo && routeInfo.pushedByRoute) {
@@ -3131,18 +3131,19 @@ const IonRouter = ({ children, registerHistoryListener }) => {
3131
3131
  * the history stack.
3132
3132
  */
3133
3133
  }
3134
- else {
3134
+ else if (defaultHref) {
3135
3135
  handleNavigate(defaultHref, 'pop', 'back', routeAnimation);
3136
3136
  }
3137
3137
  /**
3138
3138
  * No `pushedByRoute` (e.g., initial page load or tab root).
3139
- * Tabs with no back history should not navigate.
3139
+ * Navigate to defaultHref so the back button works on direct
3140
+ * deep-link loads (e.g., loading /tab1/child directly).
3141
+ * Only navigate when defaultHref is explicitly set. The core
3142
+ * back-button component hides itself when no defaultHref is
3143
+ * provided, so a click here means the user set one intentionally.
3140
3144
  */
3141
3145
  }
3142
- else {
3143
- if (routeInfo && routeInfo.tab) {
3144
- return;
3145
- }
3146
+ else if (defaultHref) {
3146
3147
  handleNavigate(defaultHref, 'pop', 'back', routeAnimation);
3147
3148
  }
3148
3149
  };