Skip to content

Commit

Permalink
Merge pull request #96 from indec-it/fix/selectInputOnChangeProps
Browse files Browse the repository at this point in the history
fix(select): fix when pass on change
  • Loading branch information
maximilianoforlenza authored Jul 17, 2022
2 parents 72f11c9 + 65b75d0 commit b315391
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 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/react-commons",
"version": "5.4.1",
"version": "5.4.2",
"description": "Common reactjs components for apps",
"private": false,
"main": "index.js",
Expand Down
8 changes: 4 additions & 4 deletions src/components/SelectInput/SelectInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ const SelectInput = ({
if (loadOptions && newValue === null && options.length === 1) {
loadOptions(0, true);
}
return form
? form.setFieldValue(field.name, valueOptions)
: onChange({target: {id: name, value: valueOptions}});
return onChange
? onChange({target: {id: field?.name || name, value: valueOptions}})
: form?.setFieldValue(field.name, valueOptions);
};

const handleClick = () => {
setSkip(skip + 1);
loadOptions(skip + 1);
loadOptions?.(skip + 1);
};

const handleInputChange = (term, action) => {
Expand Down

0 comments on commit b315391

Please sign in to comment.