Skip to content

Commit

Permalink
fix: fix Field $merge()
Browse files Browse the repository at this point in the history
  • Loading branch information
qiqiboy committed Nov 30, 2020
1 parent 54c03ef commit 08d35a4
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion dist/react-formutil.cjs.development.js
Original file line number Diff line number Diff line change
Expand Up @@ -1899,7 +1899,7 @@ function createHandler($this, owner) {
if ('$valid' in $newState) {
$newState.$invalid = !$newState.$valid;
} else if ('$invalid' in $newState) {
$newState.$dirty = !$newState.$invalid;
$newState.$valid = !$newState.$invalid;
} // process $dirty/$pristine


Expand Down
2 changes: 1 addition & 1 deletion dist/react-formutil.cjs.production.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/react-formutil.esm.development.js
Original file line number Diff line number Diff line change
Expand Up @@ -1828,7 +1828,7 @@ function createHandler($this, owner) {
if ('$valid' in $newState) {
$newState.$invalid = !$newState.$valid;
} else if ('$invalid' in $newState) {
$newState.$dirty = !$newState.$invalid;
$newState.$valid = !$newState.$invalid;
} // process $dirty/$pristine


Expand Down
2 changes: 1 addition & 1 deletion dist/react-formutil.esm.production.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/react-formutil.umd.development.js
Original file line number Diff line number Diff line change
Expand Up @@ -2635,7 +2635,7 @@
if ('$valid' in $newState) {
$newState.$invalid = !$newState.$valid;
} else if ('$invalid' in $newState) {
$newState.$dirty = !$newState.$invalid;
$newState.$valid = !$newState.$invalid;
} // process $dirty/$pristine


Expand Down
2 changes: 1 addition & 1 deletion dist/react-formutil.umd.production.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-formutil",
"version": "1.1.3",
"version": "1.1.4",
"description": "Happy to build the forms in React ^_^",
"main": "dist/index.cjs.js",
"module": "dist/index.esm.js",
Expand Down
2 changes: 1 addition & 1 deletion src/fieldHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ export function createHandler($this, owner) {
if ('$valid' in $newState) {
$newState.$invalid = !$newState.$valid;
} else if ('$invalid' in $newState) {
$newState.$dirty = !$newState.$invalid;
$newState.$valid = !$newState.$invalid;
}

// process $dirty/$pristine
Expand Down
4 changes: 2 additions & 2 deletions tests/helper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export function renderForm<Fields = any, Validators = {}, WeakFields = Fields>(
};
}

export function renderField(fieldProps?: FieldProps) {
let fieldHandler: $Fieldutil;
export function renderField<Value = string>(fieldProps?: FieldProps<Value>) {
let fieldHandler: $Fieldutil<Value>;
let formHandler: $Formutil;
let instance;
const getForm = (newProps?: FieldProps) => (
Expand Down

0 comments on commit 08d35a4

Please sign in to comment.