fix: fixes organization table UI flickers and adds sticky search & filter + table header (#11711)
* fix: #11213, #11215 * Update packages/ui/components/data-table/DataTableToolbar.tsx --------- Co-authored-by: sean-brydon <[email protected]>
This commit is contained in:
1 parent
bba52db02f
commit
e7543c10a9
3 files changed
+10
-18
No files matched your search
@@ -36,10 +36,10 @@ export function DataTableToolbar<TData>({
|
||||
const isFiltered = table.getState().columnFilters.length > 0;
|
||||
|
||||
return (
|
||||
<div className="flex items-center justify-end space-x-2">
|
||||
<div className="bg-default sticky top-[3rem] z-10 flex items-center justify-end space-x-2 py-4 md:top-0">
|
||||
{searchKey && (
|
||||
<Input
|
||||
className="max-w-64 mb-0 mr-auto"
|
||||
className="max-w-64 mb-0 mr-auto rounded-md"
|
||||
placeholder="Search"
|
||||
value={(table.getColumn(searchKey)?.getFilterValue() as string) ?? ""}
|
||||
onChange={(event) => table.getColumn(searchKey)?.setFilterValue(event.target.value)}
|
||||
|
||||
@@ -102,21 +102,9 @@ export function DataTable<TData, TValue>({
|
||||
searchKey={searchKey}
|
||||
tableCTA={tableCTA}
|
||||
/>
|
||||
<div
|
||||
className="border-subtle rounded-md border"
|
||||
ref={tableContainerRef}
|
||||
onScroll={onScroll}
|
||||
style={{
|
||||
height: "calc(100vh - 30vh)",
|
||||
overflow: "auto",
|
||||
}}>
|
||||
<div className="border-subtle border" ref={tableContainerRef} onScroll={onScroll}>
|
||||
<Table>
|
||||
<TableHeader
|
||||
style={{
|
||||
position: "sticky",
|
||||
top: 0,
|
||||
zIndex: 1,
|
||||
}}>
|
||||
<TableHeader>
|
||||
{table.getHeaderGroups().map((headerGroup) => (
|
||||
<TableRow key={headerGroup.id}>
|
||||
{headerGroup.headers.map((header) => {
|
||||
|
||||
Reference in new issue
Block a user