sadpandajoe commented on code in PR #44069:
URL: https://github.com/apache/superset/pull/44069#discussion_r3972393740


##########
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx:
##########
@@ -311,6 +315,46 @@ const FilterBar: FC<FiltersBarProps> = ({
 
         const hasRequiredValue = isRequired && isEmptyValue;
 
+        // Cascade clearing: when a parent filter's value changes, every
+        // transitive descendant (child) dependent filter must have its
+        // selection reset. Otherwise the child keeps a stale value that no
+        // longer belongs to the parent's option set (e.g. Country=UK with a
+        // City value only valid under USA), producing impossible filter
+        // combinations that blank charts.
+        const prevValue = draft[filter.id]?.filterState?.value;
+        const nextValue = baseDataMask.filterState?.value;
+        const parentValueChanged =
+          prevValue !== undefined && !isEqual(prevValue, nextValue);
+        if (parentValueChanged) {
+          const childIds = resolveTransitiveChildIds(filter.id, filters);

Review Comment:
   This clears every transitive descendant without the in-scope guard used by 
`handleClearAll`. On a tabbed dashboard, changing an in-scope parent can stage 
a clear for an out-of-scope child; `getFiltersToApply` then skips that 
null-valued child, leaving its applied selection intact (and a required child 
can disable Apply from another tab). Should this only clear descendants in 
`inScopeFilterIds`, or otherwise ensure their cleared masks are applied?



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to