Skip to content

Commit

Permalink
Merge pull request #25 from klm-lab/dev
Browse files Browse the repository at this point in the history
Reduce submit error to em
  • Loading branch information
klm-lab authored Nov 21, 2023
2 parents f006a8f + 4b9452f commit 9a1bbcd
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ An input state management for React. It comes with useful common validations if
[MIT][license-url]


[size-shield]: https://img.shields.io/bundlephobia/minzip/aio-inputs/2.1.0?style=for-the-badge
[size-shield]: https://img.shields.io/bundlephobia/minzip/aio-inputs/2.1.1?style=for-the-badge

[license-shield]: https://img.shields.io/github/license/klm-lab/inputs?style=for-the-badge

2 changes: 1 addition & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ Tracking inputs [HERE][no-tracking-link]
[MIT][license-url]


[size-shield]: https://img.shields.io/bundlephobia/minzip/aio-inputs/2.1.0?style=for-the-badge
[size-shield]: https://img.shields.io/bundlephobia/minzip/aio-inputs/2.1.1?style=for-the-badge

[license-shield]: https://img.shields.io/github/license/klm-lab/inputs?style=for-the-badge

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aio-inputs",
"version": "2.1.0",
"version": "2.1.1",
"description": "An opinionated inputs state manager for react",
"scripts": {
"build": "npm ci && npm run build:noci",
5 changes: 2 additions & 3 deletions src/util/index.ts
Original file line number Diff line number Diff line change
@@ -342,11 +342,10 @@ const touchInput = (store: InputStore, helper: Helper) => {
: input.value;
}

const { em, valid } = validate(helper, data, formKey, value);
const { em } = validate(helper, data, formKey, value);
data[formKey].touched = true;
data[formKey].errorMessage = em;
data[formKey].valid = valid;
isValid = isValid && !data[formKey].validating && valid;
isValid = isValid && !data[formKey].validating;
}
store.set((ref) => {
ref.entry = data;

0 comments on commit 9a1bbcd

Please sign in to comment.