Skip to content

Problem passing values to Sveltekit form actions #209

@miklereverie

Description

@miklereverie

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions