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: vue, ion-nav does not unmount components correctly #27428

Open
3 tasks done
ghost opened this issue May 9, 2023 · 0 comments
Open
3 tasks done

bug: vue, ion-nav does not unmount components correctly #27428

ghost opened this issue May 9, 2023 · 0 comments
Labels
package: vue @ionic/vue package type: bug a confirmed bug report

Comments

@ghost
Copy link

ghost commented May 9, 2023

Prerequisites

Ionic Framework Version

v7.x

Current Behavior

When using the IonNav and IonNavLink components in Vue for routing, going 'forward' creates a new element in the DOM, but going 'backward' does not remove that element. This results in multiple duplicate elements being created when navigating backwards then forwards again (with the current screen being shown in a higher z-index).

As a side effect, it seems than whenever vue state is updated inside the IonNav component, a new component is created entirely, rather than updating the state correctly.

Expected Behavior

Would expect IonNav to work correctly in navigating forwards and backwards through IonNavLinks without duplicating elements in the DOM, and correctly updating vue state within the components.

Steps to Reproduce

  1. git clone https://github.com/0x467/ionic-ion-nav-bug-vue
  2. npm install
  3. npm run dev
  4. Navigate between pages using the given buttons and see the dom renders duplicate components

Code Reproduction URL

https://github.com/0x467/ionic-ion-nav-bug-vue

Ionic Info

Ionic:

   Ionic CLI       : 7.1.1 (/opt/homebrew/lib/node_modules/@ionic/cli)
   Ionic Framework : @ionic/vue 7.0.5

Capacitor:

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

Utility:

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

System:

   NodeJS : v19.9.0 (/opt/homebrew/Cellar/node/19.9.0/bin/node)
   npm    : 9.6.3
   OS     : macOS Unknown

ion-nav-bug-vue % 

Additional Information

This problem looks similar to the one recently solved in React. #25753

Screen.Recording.2023-05-09.at.10.57.16.AM.mov
@ionitron-bot ionitron-bot bot added the triage label May 9, 2023
@liamdebeasi liamdebeasi changed the title bug: ion-nav does not remove component in DOM or update state correctly bug: vue, ion-nav does not unmount components correctly Jun 26, 2023
@liamdebeasi liamdebeasi added package: vue @ionic/vue package type: bug a confirmed bug report labels Jun 26, 2023
@ionitron-bot ionitron-bot bot removed the triage label Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: vue @ionic/vue package type: bug a confirmed bug report
Projects
None yet
Development

No branches or pull requests

1 participant