Skip to content

Commit

Permalink
fixed a bug
Browse files Browse the repository at this point in the history
  • Loading branch information
aednikanov committed Jul 3, 2024
1 parent 104a6cd commit 356070a
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ export const ConditionalField = (props: FieldTemplateProps) => {
setIsComplexTypeView(true);
}
const onDropdownOptionClick = (e) => {
const selectedSchema = listItems.find(({ title }) => title === e.target.innerText);
const selectedSchema = listItems.find(({ title }) => title === e.target.dataset.value);
const isNullTypeSchema = checkForNullTypeSchema(selectedSchema?.type);
if (isNullTypeSchema) {
onChange(null);
} else {
setSelectedTypeSchema(listItems.find(({ title }) => title === e.target.innerText));
setSelectedTypeSchema(listItems.find(({ title }) => title === e.target.dataset.value));
showComplexTypeView();
}
setIsOpened(false);
Expand Down Expand Up @@ -75,6 +75,7 @@ export const ConditionalField = (props: FieldTemplateProps) => {
className={styles.dropdownItem}
key={index}
onClick={onDropdownOptionClick}
data-value={listItem.title}
>
{`${listItem.title}: ${listItem?.enum ? "enum" : listItem.type}`}
</li>
Expand Down

0 comments on commit 356070a

Please sign in to comment.