Skip to content

Dynamically instantiating TabContent component causes duplication #27

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

Open
Kasopej opened this issue Nov 5, 2024 · 0 comments
Open

Comments

@Kasopej
Copy link

Kasopej commented Nov 5, 2024

First of all, thanks for adapting this package for Vue 3!

The issue is that using a v-if on a TabContent component within a FormWizard causes the tab content to be created multiple times.
i.e if the condition toggles between true & false (multiple times), the content is duplicated. Even if you add a key attribute to label the component

Example
<form-wizard> <tab-content v-if="includeTab" key="some-tab" title="Some Tab" icon="lnr lnr-apartment" /> </form-wizard>

If includeTab changes from false to true, and false to true again, the 'some-tab' TabContent is rendered multiple times even though there's only one instance passed to the default slot

Update

This is caused by injected addTab method being called by TabContent.. there is no check for uniqueness. I have opened a PR for this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant