aminghadersohi commented on code in PR #45476:
URL: https://github.com/apache/superset/pull/45476#discussion_r4330061514
##########
superset-frontend/src/components/ListView/utils.ts:
##########
@@ -347,18 +353,30 @@ export function useListViewState<D extends object = any>({
const method =
typeof query.pageIndex !== 'undefined' &&
queryParams.pageIndex !== query.pageIndex
- ? 'push'
- : 'replace';
+ ? 'pushIn'
+ : 'replaceIn';
setQuery(queryParams, method);
fetchData({ pageIndex, pageSize, sortBy, filters });
}, [fetchData, pageIndex, pageSize, sortBy, filters]);
useEffect(() => {
+ previousQuery.current = query;
if (!isEqual(initialState.pageIndex, pageIndex)) {
gotoPage(initialState.pageIndex);
}
+ const restoredInternalFilters = mergeCreateFilterValues(
+ initialFilters,
+ query.filters || {},
+ );
+ const restoredFilters = convertFilters(restoredInternalFilters);
+ if (!isEqual(restoredFilters, filters)) {
+ setAllFilters(restoredFilters);
+ }
+ if (!isEqual(restoredInternalFilters, internalFilters)) {
+ setInternalFilters(restoredInternalFilters);
+ }
Review Comment:
After searching from a later page, Back restores unfiltered results but
leaves the search text unchanged; blurring the input reapplies that stale
filter. Sync SearchFilter's local value too (Search.tsx is outside this diff,
so a suggestion cannot be anchored there).
--
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]