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:
EYHN
2025-05-21 08:17:51 +00:00
parent 2de15e2677
commit 5b46c66f52

View File

@@ -231,6 +231,7 @@ export const AllPage = () => {
}
setSelectedCollectionId(collectionId);
setTempFilters(collection.info$.value.rules.filters);
setTempFiltersInitial(null);
},
[collectionService]
);
@@ -320,6 +321,8 @@ export const AllPage = () => {
{tempFilters !== null && (
<div className={styles.filterArea}>
<Filters
// When the selected collection changes, the filters internal state should be reset
key={selectedCollectionId ?? 'all'}
className={styles.filters}
filters={tempFilters}
onChange={handleFilterChange}