@@ -132,6 +132,7 @@ export const workflowSlice = createSlice({
132
132
elements : { [ rootElement . id ] : rootElement } ,
133
133
rootElementId : rootElement . id ,
134
134
} ;
135
+ state . isTouched = true ;
135
136
} ,
136
137
formElementAdded : (
137
138
state ,
@@ -148,36 +149,44 @@ export const workflowSlice = createSlice({
148
149
if ( isNodeFieldElement ( element ) ) {
149
150
state . formFieldInitialValues [ element . id ] = initialValue ;
150
151
}
152
+ state . isTouched = true ;
151
153
} ,
152
154
formElementRemoved : ( state , action : PayloadAction < { id : string } > ) => {
153
155
const { form } = state ;
154
156
const { id } = action . payload ;
155
157
removeElement ( { form, id } ) ;
156
158
delete state . formFieldInitialValues [ id ] ;
159
+ state . isTouched = true ;
157
160
} ,
158
161
formElementReparented : ( state , action : PayloadAction < { id : string ; newParentId : string ; index : number } > ) => {
159
162
const { form } = state ;
160
163
const { id, newParentId, index } = action . payload ;
161
164
reparentElement ( { form, id, newParentId, index } ) ;
165
+ state . isTouched = true ;
162
166
} ,
163
167
formElementHeadingDataChanged : ( state , action : FormElementDataChangedAction < HeadingElement > ) => {
164
168
formElementDataChangedReducer ( state , action , isHeadingElement ) ;
169
+ state . isTouched = true ;
165
170
} ,
166
171
formElementTextDataChanged : ( state , action : FormElementDataChangedAction < TextElement > ) => {
167
172
formElementDataChangedReducer ( state , action , isTextElement ) ;
173
+ state . isTouched = true ;
168
174
} ,
169
175
formElementNodeFieldDataChanged : ( state , action : FormElementDataChangedAction < NodeFieldElement > ) => {
170
176
formElementDataChangedReducer ( state , action , isNodeFieldElement ) ;
177
+ state . isTouched = true ;
171
178
} ,
172
179
formElementContainerDataChanged : ( state , action : FormElementDataChangedAction < ContainerElement > ) => {
173
180
formElementDataChangedReducer ( state , action , isContainerElement ) ;
181
+ state . isTouched = true ;
174
182
} ,
175
183
formFieldInitialValuesChanged : (
176
184
state ,
177
185
action : PayloadAction < { formFieldInitialValues : WorkflowState [ 'formFieldInitialValues' ] } >
178
186
) => {
179
187
const { formFieldInitialValues } = action . payload ;
180
188
state . formFieldInitialValues = formFieldInitialValues ;
189
+ state . isTouched = true ;
181
190
} ,
182
191
} ,
183
192
extraReducers : ( builder ) => {
0 commit comments