Skip to content

Commit

Permalink
Change internal link none value from "0" to null (#2677)
Browse files Browse the repository at this point in the history
  • Loading branch information
finnar-bin authored Apr 15, 2024
1 parent 6bf6497 commit 6b42a1c
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ export const FieldTypeInternalLink = React.memo(function FieldTypeInternalLink(
}}
name={props.name}
placeholder={props.placeholder}
value={props.value || "0"}
onSelect={props.onChange}
value={props.value && props.value !== "0" ? props.value : null}
onSelect={(value, name) => {
props.onChange(value ? value : null, name);
}}
onFilter={onSearch}
// always render search input
searchPlaceholder="Do not see the item you are looking for? Enter a term to search your API."
Expand All @@ -38,7 +40,7 @@ export const FieldTypeInternalLink = React.memo(function FieldTypeInternalLink(
>
{/* You should always be able to unlink an internal link */}
<Option
value={props.defaultOptValue || "0"}
value={props.defaultOptValue || null}
text={props.defaultOptText || "— None —"}
/>

Expand Down

0 comments on commit 6b42a1c

Please sign in to comment.