23241a6749 commented on code in PR #77486:
URL: https://github.com/apache/airflow/pull/77486#discussion_r4695599924
##########
airflow-core/src/airflow/ui/src/components/FlexibleForm/FlexibleForm.tsx:
##########
@@ -115,19 +115,29 @@ export const FlexibleForm = ({
const newSectionError = computeSectionErrors(params,
flexibleFormDefaultSection);
setSectionError(newSectionError);
- setError(hasValidationError || newSectionError.size > 0);
- }, [params, flexibleFormDefaultSection, setError, hasValidationError]);
+ setError(Object.keys(params).some((name) => invalidFields.has(name)) ||
newSectionError.size > 0);
+ }, [params, flexibleFormDefaultSection, setError, invalidFields]);
useEffect(() => {
setDisabled(disabled ?? false);
}, [disabled, setDisabled]);
- const onUpdate = (_value?: string, error?: unknown) => {
- const newSectionError = computeSectionErrors(params,
flexibleFormDefaultSection);
+ const onUpdate = (name: string, error?: unknown) => {
Review Comment:
Thanks for catching this. I reproduced it and fixed it in `fe2e0f40`. I
added a regression test that fills the required text field, checks that Trigger
becomes enabled, then clears it and checks that Trigger is disabled again. I
also verified that filling the field while another field contains invalid YAML
keeps Trigger disabled. All 2,526 UI tests passed locally.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]