fix: clear all filters when resetting attribute search (#45109)

Closes #45108

Signed-off-by: Muhammed Oguz <muhammed0748@outlook.com>
This commit is contained in:
Muhammed Oğuz 2026-01-06 02:27:37 +03:00 committed by GitHub
parent f938d894b9
commit 12d4146eb9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 0 deletions

View File

@ -33,6 +33,7 @@ type UserDataTableAttributeSearchFormProps = {
profile: UserProfileConfig;
createAttributeSearchChips: () => ReactNode;
searchUserWithAttributes: () => void;
clearAllFilters: () => void;
};
type UserFilterForm = UserAttribute & { exact: boolean };
@ -43,6 +44,7 @@ export function UserDataTableAttributeSearchForm({
profile,
createAttributeSearchChips,
searchUserWithAttributes,
clearAllFilters,
}: UserDataTableAttributeSearchFormProps) {
const { t } = useTranslation();
const { addAlert } = useAlerts();
@ -134,6 +136,7 @@ export function UserDataTableAttributeSearchForm({
(chip) => chip.name !== chip.name,
);
setActiveFilters({ ...activeFilters, userAttribute: filtered });
clearAllFilters();
};
const createAttributeKeyInputField = () => {

View File

@ -137,6 +137,7 @@ export function UserDataTableToolbarItems({
setActiveFilters={setActiveFilters}
profile={profile}
createAttributeSearchChips={createAttributeSearchChips}
clearAllFilters={clearAllFilters}
searchUserWithAttributes={() => {
searchUserWithAttributes();
setSearchDropdownOpen(false);