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

add checkbox example to factorial form #1084

Merged
merged 2 commits into from
Jan 23, 2025

Conversation

DavidRodriguezHidalgo
Copy link
Contributor

Description

Recently we added Checkbox field to form fields but we didn't add it to the form example.

Screenshots (if applicable)

Captura de pantalla 2025-01-21 a las 14 01 01


Type of Change

  • New experimental component
  • Promote component from experimental to stable
  • Maintenance / Bug Fix / Other

@DavidRodriguezHidalgo DavidRodriguezHidalgo self-assigned this Jan 21, 2025
Copy link

github-actions bot commented Jan 21, 2025

🔍 Visual review for your branch is published 🔍

Here are the links to:

@@ -12,6 +12,7 @@ import { z, ZodType } from "zod"

export const buildFormSchema = z.object
export const stringField = z.string
export const booleanField = z.boolean
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not fully sure of this approach for this. This obscures the use of the Zod library, I think I would prefer to know what I'm using. @josepjaume Any thoughts of getting rid of this in a future PR? I'm thinking of doing an example of nested schemas and I think this approach is not the best for it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you might be right and I was aware it could cause issues with nested schemas. Feel free to simplify the API and make the dependencies more explicit :)

@DavidRodriguezHidalgo DavidRodriguezHidalgo marked this pull request as ready for review January 21, 2025 15:11
@DavidRodriguezHidalgo DavidRodriguezHidalgo requested a review from a team as a code owner January 21, 2025 15:11
@DavidRodriguezHidalgo DavidRodriguezHidalgo force-pushed the feature/add_checkbox_to_form_example branch from ef6a23a to a4a792f Compare January 21, 2025 15:21
@@ -5,6 +5,7 @@ type CheckboxProps = Omit<
"asChild"
> & {
title?: string
onCheckedChange?: (checked: boolean) => void
Copy link
Contributor

Choose a reason for hiding this comment

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

what about built in onChange? doesn't it work?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nop. I already try with onChange to make it more consistent but it wasn't updating the values. I checked the library and it seems it doesn't support the onChange.

Captura de pantalla 2025-01-22 a las 15 29 48

@DavidRodriguezHidalgo DavidRodriguezHidalgo merged commit 1456630 into main Jan 23, 2025
9 checks passed
@DavidRodriguezHidalgo DavidRodriguezHidalgo deleted the feature/add_checkbox_to_form_example branch January 23, 2025 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants