sveltejs / sveltejs/kit

Incorrect handling of decimal delimeters inside remote form number inputs

Open
#16,270 0 comments 0 reactions 1 assignee View on GitHub

@elliott-with-the-longest-name-on-github is already working on this.

Since Jul 9, 2026.

forms
Dominant language
JavaScript
Stars
20.8k
Forks
2.3k
Avg merge
1d 16h
Merged PRs (30d)
156

Description

Describe the bug

SvelteKit coerces number fields when handling data for a remote form function. However, there is an inconsistency between using "," and "." for the delimiter.

Both delimiters are widely used in different countries; thus, they should behave the same way.

In my case, when I try to use "." as a delimiter, the field is cleared (set to undefined) as SvelteKit tries to coerce it, since "20." is not a valid number. Strangely enough, "20," is coerced without an issue.

My suggestion is that when dealing with number inputs, the coercing should be done, respecting the input spec.

There is also a problem when deleting digits from a decimal. When the decimal part is deleted, the cursor inside the input jumps in front of the whole part, which is also not the expected behaviour.

https://github.com/user-attachments/assets/1d0737e7-8510-47e0-816e-6d489e1ba79a

Reproduction

https://github.com/dimitarnikolovv/remote-form-decimals-bug

Logs

System Info
System:
    OS: macOS 26.5.1
    CPU: (8) arm64 Apple M1 Pro
    Memory: 74.17 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.14.0
    Yarn: 1.22.22
    npm: 11.2.0
    pnpm: 10.15.0
  Browsers:
    Chrome: 149.0.7827.201
    Firefox: 148.0
    Safari: 26.5
  npmPackages:
    @sveltejs/adapter-node: ^5.5.7 => 5.5.7 
    @sveltejs/kit: ^2.69.1 => 2.69.1 
    @sveltejs/vite-plugin-svelte: ^7.2.0 => 7.2.0 
    svelte: ^5.56.4 => 5.56.4 
    vite: ^8.1.3 => 8.1.3
Severity

serious, but I can work around it

Additional Information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.