Skip to content

Commit

Permalink
fix: business attribute empty bubble selection issue (#11720)
Browse files Browse the repository at this point in the history
  • Loading branch information
kartikey-visa authored Oct 28, 2024
1 parent 0e4b3c1 commit a8af347
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ export default function EditBusinessAttributeModal({
event.stopPropagation();
};
/* eslint-disable-next-line react/prop-types */
const selectedItem = displayedAttributes.find((attribute) => attribute.urn === value)?.component;
const selectedItem = selectedAttribute
? selectedAttribute?.props?.component
: displayedAttributes.find((attribute) => attribute.urn === value)?.component;
return (
<StyleTag onMouseDown={onPreventMouseDown} closable={closable} onClose={onClose}>
{selectedItem}
Expand All @@ -172,7 +174,7 @@ export default function EditBusinessAttributeModal({
const onSelectValue = (selectedUrn: string) => {
const selectedSearchOption = attributeSearchOptions?.find((option) => option.props.value === selectedUrn);
setUrn(selectedUrn);
if (!selectedAttribute) {
if (selectedAttribute?.selectedUrn !== selectedUrn) {
setSelectedAttribute({
selectedUrn,
component: (
Expand Down

0 comments on commit a8af347

Please sign in to comment.