Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: pushing a view in a nested outlet can go back when it should not #28836

Open
3 tasks done
melenudo opened this issue Jan 16, 2024 · 0 comments
Open
3 tasks done

bug: pushing a view in a nested outlet can go back when it should not #28836

melenudo opened this issue Jan 16, 2024 · 0 comments
Labels
package: react @ionic/react package type: bug a confirmed bug report

Comments

@melenudo
Copy link

Prerequisites

Ionic Framework Version

v6.x, v7.x

Current Behavior

If you define a nested route like the documentation example (https://ionicframework.com/docs/react/navigation), the animation to nested route and the animation exiting nested route are wrong (in iOs when you navigate to nested route, the first time, the semi-opaque layer is missing and when you navigate back from the nested route, the nested content is immediately hidden).

I've tried the nested route definition using the documentation example:

const DashboardPage: React.FC = () => {
  return (
    <IonPage>
      <IonRouterOutlet>
        <Route exact path="/nested/page1" component={NestedPage1} />
        <Route exact path="/nested/page2" component={NestedPage2} />
      </IonRouterOutlet>
    </IonPage>
  );
};

And a suggested work around from other issue (#20219 (comment)):

const DashboardPage: React.FC = () => {
  return (
    <IonRouterOutlet ionPage={true}>
      <Route exact path="/nested/page1" component={NestedPage1} />
      <Route exact path="/nested/page2" component={NestedPage2} />
    </IonRouterOutlet>
  );
};

The first option directly has no animations (only when navigate to nested route). I've got the best results with the second option but the animations are wrong. See video (configuring chrome animation speed to 10% in dev tools):

Grabacion.de.pantalla.2024-01-16.a.las.9.57.36.mov

Expected Behavior

Identical page animations in nested and non-nested routes.

Steps to Reproduce

  1. Clone example project: https://github.com/melenudo/pure-ionic-nested
  2. Execute ionic serve
  3. Navigate to http://localhost:8100/home in Chrome (using dev tools to emulate an iOs device).
  4. Click "Go to Nested Page1".
  5. You will see missing semi-opaque layer (only the first time).
  6. Click "Go back".
  7. The content of current page is hidden and the animation to home page takes a leap.

Code Reproduction URL

https://github.com/melenudo/pure-ionic-nested

Ionic Info

[WARN] Error loading @capacitor/ios package.json: Error: Cannot find module
'@capacitor/ios/package.json'

   Require stack:
   -
   /Users/u01a34ad/.nvm/versions/node/v18.19.0/lib/node_modules/@ionic/cli/lib/project/index.js
   -
   /Users/u01a34ad/.nvm/versions/node/v18.19.0/lib/node_modules/@ionic/cli/lib/index.js
   -
   /Users/u01a34ad/.nvm/versions/node/v18.19.0/lib/node_modules/@ionic/cli/index.js
   -
   /Users/u01a34ad/.nvm/versions/node/v18.19.0/lib/node_modules/@ionic/cli/bin/ionic

[WARN] Error loading @capacitor/android package.json: Error: Cannot find module
'@capacitor/android/package.json'

   Require stack:
   -
   /Users/u01a34ad/.nvm/versions/node/v18.19.0/lib/node_modules/@ionic/cli/lib/project/index.js
   -
   /Users/u01a34ad/.nvm/versions/node/v18.19.0/lib/node_modules/@ionic/cli/lib/index.js
   -
   /Users/u01a34ad/.nvm/versions/node/v18.19.0/lib/node_modules/@ionic/cli/index.js
   -
   /Users/u01a34ad/.nvm/versions/node/v18.19.0/lib/node_modules/@ionic/cli/bin/ionic

Ionic:

Ionic CLI : 7.2.0 (/Users/u01a34ad/.nvm/versions/node/v18.19.0/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/react 7.6.4

Capacitor:

Capacitor CLI : 5.6.0
@capacitor/android : not installed
@capacitor/core : 5.6.0
@capacitor/ios : not installed

Utility:

cordova-res : not installed globally
native-run : 2.0.0

System:

NodeJS : v18.19.0 (/Users/u01a34ad/.nvm/versions/node/v18.19.0/bin/node)
npm : 10.2.3
OS : macOS Unknown

Environment:

HTTP_PROXY : http://localhost:8000
HTTPS_PROXY : http://localhost:8000

Additional Information

No response

@ionitron-bot ionitron-bot bot added the triage label Jan 16, 2024
@liamdebeasi liamdebeasi changed the title bug: wrong animations using nested routes bug: pushing a view in a nested outlet can go back when it should not Jan 16, 2024
@liamdebeasi liamdebeasi added package: react @ionic/react package type: bug a confirmed bug report labels Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: react @ionic/react package type: bug a confirmed bug report
Projects
None yet
Development

No branches or pull requests

2 participants