Skip to content

select elements change to first option on submit #16093

Description

@abdelfattahradwan

Describe the bug

If you have a select element inside a form and submit, it changes to the first available option.

Reproduction

https://stackblitz.com/edit/form-select-resetting?file=src%2Froutes%2F%2Bpage.svelte

  • Start the dev server.
  • Change the select value.
  • Click "Submit"

Logs

N/A

System Info

System:
    OS: Windows 11 10.0.26200
    CPU: (28) x64 Intel(R) Core(TM) i7-14700K
    Memory: 39.19 GB / 63.70 GB
  Binaries:
    Node: 24.16.0 - C:\Program Files\nodejs\node.EXE
    npm: 11.7.0 - ~\AppData\Roaming\npm\npm.CMD
    bun: 1.3.14 - ~\.bun\bin\bun.EXE
  Browsers:
    Edge: Chromium (149.0.4022.69)
    Internet Explorer: 11.0.26100.8115
  npmPackages:
    @sveltejs/adapter-node: 5.5.5 => 5.5.5 
    @sveltejs/kit: 2.66.0 => 2.66.0 
    @sveltejs/vite-plugin-svelte: 7.1.2 => 7.1.2 
    svelte: 5.56.3 => 5.56.3 
    vite: 8.0.16 => 8.0.16

Severity

serious, but I can work around it

Additional Information

This happens regardless of the type of value used. So, this is similar to #15835, but not exactly the same. I intentionally used strings here in the linked reproduction to show that it happens even with strings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    formsStuff relating to forms and form actions

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions