Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EPMRPP-88524 || Issue is not posted when value is entered in autocomplete fields, but there is no match with them in the integration project #3685

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) => {
Expand All @@ -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;
Expand Down
Loading