Skip to content

Commit

Permalink
Merge pull request #121 from indec-it/fix/currencyFormat
Browse files Browse the repository at this point in the history
fix(currency): avoid onBlur when component type is currency
  • Loading branch information
maximilianoforlenza authored Jun 23, 2024
2 parents 1a0a5cb + 17bf2a0 commit 8de16a4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@indec/form-builder",
"version": "3.5.0",
"version": "3.5.1",
"description": "Form builder",
"main": "index.js",
"private": false,
Expand Down
1 change: 1 addition & 0 deletions src/components/Currency/Currency.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ function Currency({form, field, label, ...props}) {
form={form}
field={field}
label={label}
onBlur={() => {}}
/>
);
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/Currency/Currency.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const section = {
question: 'S1P1',
value: 3000,
type: 'lt',
section: 'S2'
section: 'S1'
}
]
}
Expand All @@ -72,7 +72,7 @@ const section = {

function Template(args) {
const {withErrors, withWarnings, initialValues, ...props} = args;
const {errorSchema: validateSchema, warningSchema} = getSchemas({section, sections: [section]});
const {errorSchema: validateSchema, warningSchema} = getSchemas({section, sections: [section], initialValues});
return (
<Formik
initialValues={{S1: [{S1P1: {id: 1, answer: {value: initialValues || ''}}}]}}
Expand Down
2 changes: 1 addition & 1 deletion src/components/TextField/TextField.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ function TextField({form, field, placeholder, label, disabled, tooltip, warnings
field.onChange(e);
form.setFieldTouched(field.name, false);
}}
onBlur={handleBlur}
{...props}
disabled={disabled}
onBlur={handleBlur}
multiline={multiline}
rows={multiline ? 2 : 1}
/>
Expand Down

0 comments on commit 8de16a4

Please sign in to comment.