Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug]: [docs] Missing field in the data table example #133

Open
2 tasks done
AlexanderHott opened this issue Dec 7, 2024 · 4 comments · May be fixed by #130
Open
2 tasks done

[bug]: [docs] Missing field in the data table example #133

AlexanderHott opened this issue Dec 7, 2024 · 4 comments · May be fixed by #130
Labels
bug Something isn't working

Comments

@AlexanderHott
Copy link

Describe the bug

In the data table walk through, there is a missing field in the "Filtering" section.

there should also be the field onColumnFiltersChange: setColumnFilters, set on the table variable.

I also think the function is missing return.

I'd be willing to open a PR fixing this.

Affected component/components

DataTable

How to reproduce

  1. Follow https://shadcn-solid.com/docs/components/data-table
  2. See that the provided code doesn't function.

Codesandbox/StackBlitz link

https://shadcn-solid.com/docs/components/data-table

Logs

No response

System Info

...

Before submitting

  • I've made research efforts and searched the documentation
  • I've searched for existing issues
@AlexanderHott AlexanderHott added the bug Something isn't working label Dec 7, 2024
@AlexanderHott
Copy link
Author

Also, the text input should be updated to

import {
  TextField,
  TextFieldRoot,
} from "~/components/ui/textfield";

// ...

        <TextFieldRoot>
          <TextField
            placeholder="Filter title..."
            value={(table.getColumn("title")?.getFilterValue() as string) ?? ""}
            onInput={(event) => {
              return table
                .getColumn("title")
                ?.setFilterValue(event.currentTarget.value);
            }}
            class="max-w-sm"
          />
        </TextFieldRoot>

@AlexanderHott
Copy link
Author

The line in "Visibility" should be highlighted
} from "@/components/ui/dropdown-menu";

@AlexanderHott
Copy link
Author

In "Visibility", DropdownMenuTrigger should be changed to

import { Button } from "~/components/ui/button";
import {
  DropdownMenu,
  DropdownMenuCheckboxItem,
  DropdownMenuContent,
  DropdownMenuTrigger
} from "@/components/ui/dropdown-menu";

// ...

          <DropdownMenuTrigger
            as={(props: DropdownMenuSubTriggerProps) => (
              <Button variant="outline" class="ml-auto" {...props}>
                Columns
              </Button>
            )}
          />

@hngngn hngngn linked a pull request Dec 9, 2024 that will close this issue
5 tasks
@hngngn
Copy link
Owner

hngngn commented Dec 9, 2024

Thanks, this will be included in the next update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants