diff --git a/package.json b/package.json index 5ab65ef..1331aab 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/components/SelectInput/SelectInput.js b/src/components/SelectInput/SelectInput.js index f311d43..3547640 100644 --- a/src/components/SelectInput/SelectInput.js +++ b/src/components/SelectInput/SelectInput.js @@ -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) => {