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

Change internal link none value from "0" to null #2677

Merged
merged 1 commit into from
Apr 15, 2024
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 @@ -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
Loading