fix(core): fix all docs filters internal state reset (#12412)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Improved filter behavior by resetting filter state when editing or switching collections, ensuring filters are cleared appropriately. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -231,6 +231,7 @@ export const AllPage = () => {
|
|||||||
}
|
}
|
||||||
setSelectedCollectionId(collectionId);
|
setSelectedCollectionId(collectionId);
|
||||||
setTempFilters(collection.info$.value.rules.filters);
|
setTempFilters(collection.info$.value.rules.filters);
|
||||||
|
setTempFiltersInitial(null);
|
||||||
},
|
},
|
||||||
[collectionService]
|
[collectionService]
|
||||||
);
|
);
|
||||||
@@ -320,6 +321,8 @@ export const AllPage = () => {
|
|||||||
{tempFilters !== null && (
|
{tempFilters !== null && (
|
||||||
<div className={styles.filterArea}>
|
<div className={styles.filterArea}>
|
||||||
<Filters
|
<Filters
|
||||||
|
// When the selected collection changes, the filters internal state should be reset
|
||||||
|
key={selectedCollectionId ?? 'all'}
|
||||||
className={styles.filters}
|
className={styles.filters}
|
||||||
filters={tempFilters}
|
filters={tempFilters}
|
||||||
onChange={handleFilterChange}
|
onChange={handleFilterChange}
|
||||||
|
|||||||
Reference in New Issue
Block a user