The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
fix(front): enable Save when a select option is added programmatically (#24649)
Karthikram319eb4a197c1997
diff --git a/packages/twenty-front/src/modules/settings/data-model/fields/forms/select/components/SettingsDataModelFieldSelectForm.tsx b/packages/twenty-front/src/modules/settings/data-model/fields/forms/select/components/SettingsDataModelFieldSelectForm.tsxindex ee8d223853f..2aa954ead24 100644--- a/packages/twenty-front/src/modules/settings/data-model/fields/forms/select/components/SettingsDataModelFieldSelectForm.tsx+++ b/packages/twenty-front/src/modules/settings/data-model/fields/forms/select/components/SettingsDataModelFieldSelectForm.tsx@@ -203,7 +203,10 @@ export const SettingsDataModelFieldSelectForm = ({const optionsWithNew = [...initialOptions, newOption];- setFormValue('options', optionsWithNew, { shouldDirty: true });+ setFormValue('options', optionsWithNew, {+ shouldDirty: true,+ shouldValidate: true,+ });setHasAppliedNewOption(true);}}, [searchParams, hasAppliedNewOption, initialOptions, setFormValue]);@@ -301,13 +304,19 @@ export const SettingsDataModelFieldSelectForm = ({const handleAddOption = () => {const newOptions = getOptionsWithNewOption();- setFormValue('options', newOptions, { shouldDirty: true });+ setFormValue('options', newOptions, {+ shouldDirty: true,+ shouldValidate: true,+ });};const handleInputEnter = () => {const newOptions = getOptionsWithNewOption();- setFormValue('options', newOptions, { shouldDirty: true });+ setFormValue('options', newOptions, {+ shouldDirty: true,+ shouldValidate: true,+ });};return (