fields.number() doesn't enforce number.
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 62/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- javascript, node.js
- Domain
- backend
Research direction
Start by reproducing the supplied fields.number() example with the string value, then inspect the fields.number() implementation and its validation path. Done means non-numeric input is rejected while valid numbers retain their current behavior; add or update a regression test if the repository’s existing test structure identifies one.
Written by the indexing model from the issue text.
Description
When I use fields.number(), it validates even if the field is not a number.
import forms, { fields, validators } from 'forms';
const nestedForm = forms.create({
age: fields.number({ required: validators.required('age') }),
});
const handlers = {
success(form) {
console.log('success');
},
other(form) {
console.log('fail');
},
};
nestedForm.handle({ age: 'this is a text' }, handlers);
// console prints "success"
- Dominant language
- JavaScript
- Stars
- 1k
- Forks
- 161
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from caolan/forms
-
Cut a new release? Open
Difficulty 5/5 Over a week Newbie friendliness 20/100
-
Feature Requests pull request wanted
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
-
simple checkbox Open
Difficulty 3/5 1-2 days Newbie friendliness 30/100
-
Feature Requests
Difficulty 3/5 1-2 days Newbie friendliness 35/100
Similar issues
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
githubnext/gh-aw-workshop#3692 ·
-
agent/guide documentation hive/hosted-available-lke648397-260827-5n31
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
Add: BuyPass TV Openchannels:add check:passed
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
S: triage
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 90/100
apache/cloudstack#14222 ·