From 02b22967274e103f47eb4656603beab1ffb250df Mon Sep 17 00:00:00 2001 From: Renaud AMSELLEM Date: Thu, 14 Nov 2024 18:27:38 +0100 Subject: [PATCH] fix(admin): multiple value meca switches --- .../ValuesListTab/ValuesListForm/ValuesListForm.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/admin/src/components/attributes/EditAttribute/EditAttributeTabs/ValuesListTab/ValuesListForm/ValuesListForm.tsx b/apps/admin/src/components/attributes/EditAttribute/EditAttributeTabs/ValuesListTab/ValuesListForm/ValuesListForm.tsx index b4312a9a3..e51f2c94e 100644 --- a/apps/admin/src/components/attributes/EditAttribute/EditAttributeTabs/ValuesListTab/ValuesListForm/ValuesListForm.tsx +++ b/apps/admin/src/components/attributes/EditAttribute/EditAttributeTabs/ValuesListTab/ValuesListForm/ValuesListForm.tsx @@ -96,7 +96,12 @@ function ValuesListForm({attribute, onSubmit}: IValuesListFormProps): JSX.Elemen dispatch({type: 'toggle_allow_list_update'}); } }; - const _toggleAllowListUpdate = () => dispatch({type: 'toggle_allow_list_update'}); + const _toggleAllowListUpdate = () => { + dispatch({type: 'toggle_allow_list_update'}); + if (!state.conf.allowListUpdate && !state.conf.allowFreeEntry) { + dispatch({type: 'toggle_allow_free_entry'}); + } + }; const _extractValuesToSave = useCallback( (conf: IValuesListConf): string[] => {