Skip to content

Commit

Permalink
fix(data-table): uncontrolled input error on data-table (#335)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackblatch authored May 11, 2023
1 parent 4a7c07e commit 5a2ce61
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function DataTableToolbar<TData>({
<div className="flex flex-1 items-center space-x-2">
<Input
placeholder="Filter tasks..."
value={table.getColumn("title")?.getFilterValue() as string}
value={(table.getColumn("title")?.getFilterValue() as string) ?? ""}
onChange={(event) =>
table.getColumn("title")?.setFilterValue(event.target.value)
}
Expand Down
2 changes: 1 addition & 1 deletion apps/www/components/examples/data-table/data-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export function DataTable<TData, TValue>({
<div className="flex items-center py-4">
<Input
placeholder="Filter emails..."
value={table.getColumn("email")?.getFilterValue() as string}
value={(table.getColumn("email")?.getFilterValue() as string) ?? ""}
onChange={(event) =>
table.getColumn("email")?.setFilterValue(event.target.value)
}
Expand Down
2 changes: 1 addition & 1 deletion apps/www/content/docs/components/data-table.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ export function DataTable<TData, TValue>({
<div className="flex items-center py-4">
<Input
placeholder="Filter emails..."
value={table.getColumn("email")?.getFilterValue() as string}
value={(table.getColumn("email")?.getFilterValue() as string) ?? ""}
onChange={(event) =>
table.getColumn("email")?.setFilterValue(event.target.value)
}
Expand Down

1 comment on commit 5a2ce61

@vercel
Copy link

@vercel vercel bot commented on 5a2ce61 May 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

ui – ./apps/www

ui-git-main-shadcn-pro.vercel.app
ui-shadcn-pro.vercel.app
example-playground.vercel.app
ui.shadcn.com

Please sign in to comment.