Skip to content

bug: ionic vue getting wrong leaving view with dynamic urls #22658

Closed

Description

@duncanreid

Ionic Version:
[ ] 4.x
[x] 5.x

Current behavior:
It seems as though doing a router.push with a param, to a view that is currently visible, in this case a search view, will make things get kind of wonky. It's kind of hard to explain but if you go back and forth a couple times, while also doing a router.push to the current page you're on, the navigation just stops working. The URL keeps changing though.

Expected behavior:
proper navigation.

Steps to reproduce:
Using the sample repo below. this may seem convoluted, apologies, bear with me...
home:
1.) enter search term, click search button
search page:
1.) enter search term, click search button ( router.push current route )
2.) click home button
home:
1.) enter new search term, click search button
search page:
1.) click home button,
- url changes but view does not
2.) click about button
3.) on about page click search button, go to back to search page
4.) enter search term and click search
5.) click about button again, url changes but view does not.
6.) none of the buttons on the search page should do anything at this point except change the URL, and there should be about 7 ion-pages in the router outlet stack.

Related code:
Sample Repo:
https://github.com/duncanreid/ion-router-outlet-debug
same comments from above in /src/router/index.ts

Other information:
have tried 5.5.1 and 5.6.0-dev.202012091649.c699e16 for both @ionic/vue and @ionic/vue-router and have the same result.

Ionic info:

Ionic:

   Ionic CLI       : 6.12.2 (.nvm/versions/node/v12.0.0/lib/node_modules/@ionic/cli)
   Ionic Framework : @ionic/vue 5.6.0-dev.202012091649.c699e16

Capacitor:

   Capacitor CLI   : 2.4.4
   @capacitor/core : 2.4.4

Utility:

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

System:

   NodeJS : v12.0.0 (.nvm/versions/node/v12.0.0/bin/node)
   npm    : 6.9.0
   OS     : macOS Catalina

Activity

  1. liamdebeasi commented on Dec 9, 2020

    @liamdebeasi
    Contributor

    Thanks for the issue. From my understanding the issue is happening in the following step:

    5.) click about button again, url changes but view does not.

    So you click the about button, the url changes, but the about page does not transition in. Did I get that right?

  2. added
    needs: reply
    on Dec 9, 2020
  3. duncanreid commented on Dec 9, 2020

    @duncanreid
    Author

    It happens a bit before that, I probably could have numbered these steps better and I apologize for that.
    home -> search -> search again -> home -> search
    on search page:
    1.) click home button

    • url changes but view does not

    The rest was just more clicking around which will disable more of the routing. If you follow those steps in the attached repo, and I realize it seems strange, you should see it.

  4. added and removed
    needs: reply
    on Dec 9, 2020
  5. liamdebeasi commented on Dec 9, 2020

    @liamdebeasi
    Contributor

    Thanks! I can reproduce the issue now. I think I was reusing search queries which caused the URLs be the same.

    The Home page is being shown, but the "leaving" page is not being hidden, so it appears on top of the Home page. I will work on a fix for this.

  6. changed the title [-]bug: vue - ion-router-outlet page transitions stop working[/-] [+]bug: ionic vue getting wrong leaving view with dynamic urls[/+] on Dec 9, 2020
  7. added
    package: vue
    type: bug
    on Dec 9, 2020
  8. added this to the 5.5.3 milestone on Dec 9, 2020
  9. duncanreid commented on Dec 9, 2020

    @duncanreid
    Author

    Excellent. Thank you!

  10. liamdebeasi commented on Dec 10, 2020

    @liamdebeasi
    Contributor

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

    npm install @ionic/[email protected] @ionic/[email protected]
    
  11. duncanreid commented on Dec 10, 2020

    @duncanreid
    Author

    It does, thank you!

  12. liamdebeasi commented on Dec 10, 2020

    @liamdebeasi
    Contributor

    Great! I am going to keep this issue open until I can merge in my PR.

  13. virusv commented on Dec 11, 2020

    @virusv

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

    npm install @ionic/[email protected] @ionic/[email protected]
    

    If I am on a page and try to navigate to a similar page, but with a different parameter, then nothing happens.
    https://youtu.be/Ts-hn3q-qug

  14. liamdebeasi commented on Dec 11, 2020

    @liamdebeasi
    Contributor

    @virusv Can you provide a GitHub repo that shows this issue happening?

  15. virusv commented on Dec 11, 2020

    @virusv

    Found a message where you have already answered this question, I'm talking about the same problem problem.
    #22654 (comment)

    I understand that in fact this is the standard behavior for vue-router, but there this was solved by setting the key:
    <router-view :key="$route.fullPath"></router-view>

  16. liamdebeasi commented on Dec 11, 2020

    @liamdebeasi
    Contributor

    Thanks for the clarification. Yeah, this is definitely something we should add to Ionic Vue. I created an issue for this here: #22662.

  17. liamdebeasi commented on Dec 16, 2020

    @liamdebeasi
    Contributor

    Thanks for the issue. This has been resolved via #22655, and a fix will be available in an upcoming release of Ionic Framework.

  18. added a commit that references this issue on Dec 16, 2020
    e3a05bf
  19. ionitron-bot commented on Jan 15, 2021

    @ionitron-bot

    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.

  20. locked and limited conversation to collaborators on Jan 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    package: vuetype: bug

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions