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

Problem passing values to Sveltekit form actions #209

Open
miklereverie opened this issue Jul 10, 2023 · 0 comments
Open

Problem passing values to Sveltekit form actions #209

miklereverie opened this issue Jul 10, 2023 · 0 comments

Comments

@miklereverie
Copy link

Hello!
First of all, thank you for this amazing component!

I'm having a bit of trouble passing the values from the autocomplete (with multiple enabled, an array of objects) to a form action using Sveltekit. For some reason, I only get an empty array.

I've created a reproduction of the issue in this SvelteLab REPL:
https://www.sveltelab.dev/5k0yutjgm1cqa3z

Check out the devtools console once you submit the form, you'll see the output from line 34 is an empty array, despite having the log from line 32 which outputs the value of the selected items (which are binded to a variable, like the example provided in the docs).
I'm thinking maybe the autocomplete doesn't store formData? how would I go about passing the values to a form action in page.server.ts?

Am I doing something wrong?

Thanks in advance for your time and your help!

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