The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
Put back previous empty option (#14542)
Thomas Trompettee69131790c67
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormSelectFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormSelectFieldInput.tsxindex eca7f7992d5..cac2cb6bebb 100644--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormSelectFieldInput.tsx+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormSelectFieldInput.tsx@@ -13,6 +13,7 @@ import { useTheme } from '@emotion/react';import { useId, useState } from 'react';import { Key } from 'ts-key-enum';import { isDefined } from 'twenty-shared/utils';+import { IconCircleOff } from 'twenty-ui/display';import { type SelectOption } from 'twenty-ui/input';type FormSelectFieldInputProps = {@@ -94,16 +95,9 @@ export const FormSelectFieldInput = ({const defaultEmptyOption = {label: `No ${label ?? 'value'}`,value: '',+ icon: IconCircleOff,};- const existingEmptyOption = options.find(- (option) => !isDefined(option.value) || option.value === '',- );-- const optionsWithEmptyOption = isDefined(existingEmptyOption)- ? options- : [defaultEmptyOption, ...options];-const handleUnlinkVariable = () => {setDraftValue({type: 'static',@@ -138,10 +132,10 @@ export const FormSelectFieldInput = ({{draftValue.type === 'static' ? (<SelectdropdownId={`${instanceId}-select-display`}- options={optionsWithEmptyOption}+ options={options}value={selectedOption?.value}onChange={onSelect}- emptyOption={existingEmptyOption ?? defaultEmptyOption}+ emptyOption={defaultEmptyOption}fullWidthhasRightElement={isDefined(VariablePicker) && !readonly}withSearchInput