Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

prevTab() does not call afterTabChange #250

Open
fvanderwielen opened this issue Jun 19, 2018 · 2 comments
Open

prevTab() does not call afterTabChange #250

fvanderwielen opened this issue Jun 19, 2018 · 2 comments

Comments

@fvanderwielen
Copy link

As I want to scroll the top of the tab into view, I would like to be able to execute a function when a tab is complete. Looking at the source, the afterTabChange function seems to do this:

<tab-content title="someTab" :after-change="()=>someFunction()">

setting this on a tab does work when navigating normally through the tabs (by clicking next), but it is not called after the user navigates in reverse (e.g. by using the previous button).

This seems to be part of the nextTab and prevTab functions, or the changeTab function, but I am not sure. See:
https://github.com/cristijora/vue-form-wizard/blob/master/src/components/FormWizard.vue#L310

@ffflabs
Copy link

ffflabs commented Jul 5, 2018

You can enable backwards validation doing

 <form-wizard :validateOnBack="true">...</form-wizard>

See: https://cristijora.github.io/vue-form-wizard/#/?id=form-wizard-props

@minasm
Copy link

minasm commented Jul 21, 2018

@amenadiel thanks for the example.

<form-wizard  :validateOnBack="true">
    <tab-content title="FirstTab" :before-change="Function1">...</tab-content>
    <tab-content title="SecondTab" :after-change="Function2">...</tab-content>
</form-wizard>

I could not make it work. Function1 runs normally when Next button is clicked while on FirstTab, but I want to trigger Function2 when Back button is clicked while on SecondTab.

Am I missing something?

Thank you.

Also, the link you shared is not working anymore.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants