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

How to preserve values between multi tabs form? #119

Open
boussadjra opened this issue Jan 30, 2025 · 1 comment
Open

How to preserve values between multi tabs form? #119

boussadjra opened this issue Jan 30, 2025 · 1 comment
Labels
✨ enhancement New feature or request 🧠 think-tank Needs more discussion and opinions to iron out the fine details

Comments

@boussadjra
Copy link

Describe the bug
I've a multi tabs form where the inputs are splited between more that one tab. I want to collect the form values in one object and to keep the values when changing between the tabs.

To Reproduce
Steps to reproduce the behavior:

1- Check this playground example
2- Fill the current tab fields then navigate to the other one then come back, you'll find the values are reset

Expected behavior

The values should be preserved when navigating between tabs

-Formwerk Version 0.6.3

@boussadjra boussadjra added the ⏳ triage Evaluate the issue and assign the appropriate priority label label Jan 30, 2025
@logaretm logaretm added 📦 core-component A component composable ✨ enhancement New feature or request and removed ⏳ triage Evaluate the issue and assign the appropriate priority label 📦 core-component A component composable labels Jan 31, 2025
@logaretm
Copy link
Member

Right now this isn't something we are thinking about. You could maintain the values yourself during switching.

Here is a quick edit that makes it work by caching the values just before the transition:

https://stackblitz.com/edit/formwerk-numberflow-uf5cu7kc?file=src%2FApp.vue,src%2Fcomponents%2Fui%2FTabs.vue,src%2Fcomponents%2FTextField.vue

We are thinking about the multistep forms however which is similar to this. Maybe we could consider something for tabs.

@logaretm logaretm added the 🧠 think-tank Needs more discussion and opinions to iron out the fine details label Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement New feature or request 🧠 think-tank Needs more discussion and opinions to iron out the fine details
Projects
None yet
Development

No branches or pull requests

2 participants