yuseok89 commented on code in PR #74885:
URL: https://github.com/apache/airflow/pull/74885#discussion_r4434144844
##########
airflow-core/src/airflow/ui/src/components/FlexibleForm/FieldDropdown.tsx:
##########
@@ -58,6 +79,18 @@ export const FieldDropdown = ({ name, namespace = "default",
onUpdate }: Flexibl
? (options.find((opt) => opt.value === String(param.value)) ?? null)
: null;
+ // A parent change can leave the value outside the new options, so clear it
+ const isStale = dependsOn !== undefined && param.value !== null &&
currentValue === null;
+
+ useEffect(() => {
+ const current = paramsDict[name];
+
+ if (isStale && current) {
+ setParamsDict({ ...paramsDict, [name]: { ...current, value: null } });
Review Comment:
With `country` defaulting to `de` and `berlin` being a valid city for it, a
JSON config containing only `{"city":"berlin"}` seems to have city cleared to
null here.
Is clearing the child also intended when the parent is omitted from the JSON
config?
--
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]