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: useIonRouter doesn't use animation on replace #25831

Closed
4 of 7 tasks
dkern opened this issue Aug 25, 2022 · 5 comments · Fixed by #25863
Closed
4 of 7 tasks

bug: useIonRouter doesn't use animation on replace #25831

dkern opened this issue Aug 25, 2022 · 5 comments · Fixed by #25863
Labels
package: vue @ionic/vue package type: bug a confirmed bug report

Comments

@dkern
Copy link

dkern commented Aug 25, 2022

Prerequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x
  • Nightly

Current Behavior

When using replace on ionRouter no animation is used. Wherever using push and a custom animation works fine. When adding a console.log inside the custom animation, it seems that the function is not even called on replace.

Expected Behavior

As seen in the documentation, even replace should use custom animations. Also, the definition file shows that replace uses a custom animation:

export interface UseIonRouterResult {
    // ...
    push: (location: any, routerAnimation?: AnimationBuilder) => void;
    replace: (location: any, routerAnimation?: AnimationBuilder) => void;
    // ...
}

Steps to Reproduce

import { useIonRouter, createAnimation } from '@ionic/vue';

// ...

setup() {
    const ionRouter = useIonRouter();

    const customAnimation = (baseEl: any, opts?: any) => {
        return createAnimation()
            .addElement(baseEl)
            .duration(2500)
            .fromTo('opacity', '1', '0');
    };

    ionRouter.replace('/route', customAnimation);
}

Code Reproduction URL

https://github.com/dkern/router-bug

Ionic Info

Ionic:

   Ionic CLI       : 6.20.1 (C:\Users\daker\AppData\Roaming\nvm\v14.17.0\node_modules\@ionic\cli)
   Ionic Framework : @ionic/vue 6.2.4

Capacitor:

   Capacitor CLI      : 4.0.1
   @capacitor/android : 4.1.0
   @capacitor/core    : 4.1.0
   @capacitor/ios     : 4.1.0

Utility:

   cordova-res : 0.15.4
   native-run  : 1.6.0

System:

   NodeJS : v14.17.0 (C:\Program Files\nodejs\node.exe)
   npm    : 6.14.13
   OS     : Windows 10

Additional Information

No response

@ionitron-bot ionitron-bot bot added the triage label Aug 25, 2022
@liamdebeasi
Copy link
Contributor

Thanks for the issue. Do you have a GitHub repo that I can use to verify this behavior?

@liamdebeasi liamdebeasi added the needs: reply the issue needs a response from the user label Aug 25, 2022
@ionitron-bot ionitron-bot bot removed the triage label Aug 25, 2022
@dkern
Copy link
Author

dkern commented Aug 25, 2022

Thanks for the issue. Do you have a GitHub repo that I can use to verify this behavior?

I made one now.
https://github.com/dkern/router-bug

@ionitron-bot ionitron-bot bot added triage and removed needs: reply the issue needs a response from the user labels Aug 25, 2022
@liamdebeasi liamdebeasi self-assigned this Aug 31, 2022
@liamdebeasi liamdebeasi added package: vue @ionic/vue package type: bug a confirmed bug report labels Aug 31, 2022
@liamdebeasi liamdebeasi removed their assignment Aug 31, 2022
@ionitron-bot ionitron-bot bot removed the triage label Aug 31, 2022
@liamdebeasi
Copy link
Contributor

Thanks for the issue. Can you try the following dev build, and let me know if it resolves the issue?

npm install @ionic/vue@6.2.5-dev.11661955528.139d8be6 @ionic/vue-router@6.2.5-dev.11661955528.139d8be6

@liamdebeasi
Copy link
Contributor

liamdebeasi commented Sep 6, 2022

Thanks for the issue. This has been resolved via #25863, and a fix will be available in an upcoming release of Ionic Framework. Please feel free to continue testing the dev build.

@ionitron-bot
Copy link

ionitron-bot bot commented Oct 6, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Oct 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: vue @ionic/vue package type: bug a confirmed bug report
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants