File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
src/components/ScenarioParameters/components/ScenarioParametersInputs Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ import { AgGridUtils, FileBlobUtils } from '@cosmotech/core';
99import { useTranslation } from 'react-i18next' ;
1010import PropTypes from 'prop-types' ;
1111import { useSelector } from 'react-redux' ;
12+ import { useFormContext } from 'react-hook-form' ;
13+
1214import { TableExportDialog } from './components' ;
1315import { gridLight , gridDark } from '../../../../theme/' ;
1416import { ConfigUtils , TranslationUtils , FileManagementUtils } from '../../../../utils' ;
@@ -49,6 +51,9 @@ export const GenericTable = ({
4951 isDirty,
5052} ) => {
5153 const { t } = useTranslation ( ) ;
54+
55+ const { resetField } = useFormContext ( ) ;
56+
5257 const organizationId = useOrganizationId ( ) ;
5358 const workspaceId = useWorkspaceId ( ) ;
5459 const datasets = useSelector ( ( state ) => state . dataset ?. list ?. data ) ;
@@ -439,8 +444,12 @@ export const GenericTable = ({
439444 const onCellChange = updateOnFirstEdition ;
440445
441446 const onClearErrors = ( ) => {
442- updateParameterValue ( {
443- errors : null ,
447+ resetField ( parameterId , {
448+ keepError : false ,
449+ defaultValue : {
450+ ...parameterValue ,
451+ errors : null ,
452+ } ,
444453 } ) ;
445454 } ;
446455
You can’t perform that action at this time.
0 commit comments