fix: keep search term on the url (DataTableToolbar.SearchBar) (#20521)

* fix: keep search term on the url (DataTableToolbar.SearchBar)

* update comment

* Update packages/features/data-table/components/DataTableToolbar.tsx

Co-authored-by: sean-brydon <[email protected]>

---------

Co-authored-by: sean-brydon <[email protected]>
This commit is contained in:
Eunjae Leeandsean-brydon authored and GitHub committed 2025-04-03 12:59:36 +02:00
1 parent f353fdf252
commit 1e7453edcd
7 files changed
+67 -80

No files matched your search

@@ -68,12 +68,11 @@ function UserListTableContent({ oAuthClientId }: PlatformManagedUsersTableProps)
const { t } = useLocale();
const [state, dispatch] = useReducer(reducer, initialState);
const [debouncedSearchTerm, setDebouncedSearchTerm] = useState("");
const [rowSelection, setRowSelection] = useState({});
const columnFilters = useColumnFilters();
const { pageIndex, pageSize } = useDataTable();
const { pageIndex, pageSize, searchTerm } = useDataTable();
const limit = pageSize;
const offset = pageIndex * pageSize;
@@ -81,7 +80,7 @@ function UserListTableContent({ oAuthClientId }: PlatformManagedUsersTableProps)
{
limit,
offset,
searchTerm: debouncedSearchTerm,
searchTerm,
filters: columnFilters,
oAuthClientId,
},
@@ -289,11 +288,7 @@ function UserListTableContent({ oAuthClientId }: PlatformManagedUsersTableProps)
paginationMode="standard"
ToolbarLeft={
<>
<DataTableToolbar.SearchBar
table={table}
onSearch={(value) => setDebouncedSearchTerm(value)}
className="sm:max-w-64 max-w-full"
/>
<DataTableToolbar.SearchBar className="sm:max-w-64 max-w-full" />
<DataTableFilters.ColumnVisibilityButton table={table} />
<DataTableFilters.FilterBar table={table} />
</>