diff --git a/static/app/components/organizations/hybridFilter.tsx b/static/app/components/organizations/hybridFilter.tsx index d2201518b31527..15b2679edb08c0 100644 --- a/static/app/components/organizations/hybridFilter.tsx +++ b/static/app/components/organizations/hybridFilter.tsx @@ -52,6 +52,11 @@ export interface HybridFilterProps * Useful for things like enforcing a selection count limit. */ disableCommit?: boolean; + /** + * Additional staged changes from external state that should trigger + * the Apply/Cancel buttons. + */ + hasExternalChanges?: boolean; /** * Message to show in the menu footer */ @@ -96,6 +101,7 @@ export function HybridFilter({ checkboxWrapper, checkboxPosition, disableCommit, + hasExternalChanges = false, ...selectProps }: HybridFilterProps) { /** @@ -115,11 +121,13 @@ export function HybridFilter({ }, [onStagedValueChange, stagedValue]); /** - * Whether there are staged, uncommitted changes. Used to determine whether we should - * show the "Cancel"/"Apply" buttons. + * Whether there are staged, uncommitted changes, or external changes. Used to determine + * whether we should show the "Cancel"/"Apply" buttons. */ const hasStagedChanges = - stagedValue.length !== value.length || !stagedValue.every(val => value.includes(val)); + stagedValue.length !== value.length || + !stagedValue.every(val => value.includes(val)) || + hasExternalChanges; const commit = useCallback( (val: Value[]) => {