From 030eac3e1bf5f09aa0b36f773dc10a2271e4af84 Mon Sep 17 00:00:00 2001 From: Vadzim Hvazdovich Date: Tue, 5 Dec 2023 18:28:43 +0300 Subject: [PATCH] EPMRPP-88524 || Issue is not posted when value is entered in autocomplete fields, but there is no match with them in the integration project --- .../dynamicFieldsSection/fields/autocompleteField.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/components/fields/dynamicFieldsSection/fields/autocompleteField.jsx b/app/src/components/fields/dynamicFieldsSection/fields/autocompleteField.jsx index 8d5430e97e..5c09a046d3 100644 --- a/app/src/components/fields/dynamicFieldsSection/fields/autocompleteField.jsx +++ b/app/src/components/fields/dynamicFieldsSection/fields/autocompleteField.jsx @@ -18,6 +18,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import { AsyncAutocomplete } from 'componentLibrary/autocompletes/asyncAutocomplete'; import { URLS } from 'common/urls'; +import { isEmptyObject } from 'common/utils'; import { DynamicField } from '../dynamicField'; export const AutocompleteField = ({ field, darkView, integrationInfo, ...rest }) => { @@ -36,7 +37,10 @@ export const AutocompleteField = ({ field, darkView, integrationInfo, ...rest }) if (typeof changes.selectedItem === 'string') { return { ...changes, - selectedItem: changes.selectedItem === '' ? [] : { ...state.selectedItem }, + selectedItem: + changes.selectedItem === '' || isEmptyObject(state.selectedItem) + ? [] + : { ...state.selectedItem }, }; } else { return changes;